Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jetli Jerry

@Jetli Jerry
About
Posts
41
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Working With Edit Control
    J Jetli Jerry

    Suresh H wrote:

    SendDlgItemMessage(hwnd,IDC_PATH,(LPARAM)szDir,0,0);

    SetDlgItemText(IDC_PATH,szDir); should do hth

    Jetli Constant Thing In World Is Change.

    C / C++ / MFC help tutorial question

  • Monday mornings
    J Jetli Jerry

    Yes, dont feel like working on mondays, sleepy and yes, waiting to new project to start. actually i dont have idea what will be there in new project..they've just said wait new project is ocming

    Jetli Constant Thing In World Is Change.

    The Lounge help question

  • how to detect server closed abnormally,
    J Jetli Jerry

    hi all, I am having non-blocking TCP socket, trying to receive in a loop for requried bytes. I am disconnectiing server by removing n/w cable from m/c running server application. every time recv() fails with WSAWOULDBLOCK, why? How can i detect that server died abnormally at client end? recv() also not returning 0? following is code iMode = 1; // non-zero = non-blocking mode iResult = ioctlsocket(sockMain,FIONBIO,(u_long FAR*)&iMode); iDataGot=0; while ( iData2Recv >= iDataGot ) { // recv single byte at a time iResult = recv(sockMain,&chData,1,0); // if zero byte got or any other error if ( iResult == 0 ) { //never reach here break; } /* timeout scheme // check timeout period DWORD dwCur = GetTickCount(); if ( dwCur > dwTimeout ) { // timeout occured, so we failed break; } */ if ( iResult == SOCKET_ERROR ) { if ( WSAGetLastError() != WSAEWOULDBLOCK ) { // never reaches here break; } else { // always executed. continue; } } // we got something add into output string if ( iResult == 1 ) { // add data,update counter into string and break if all datalen is received. } client application calls receive() after 10sec and it timeouts after 10sec if no data arrived. I want eliminate later 10sec. and detect server has died. Thanks in advance.

    Jetli Constant Thing In World Is Change.

    C / C++ / MFC question sysadmin help tutorial announcement

  • Visual studio 2005 installation question
    J Jetli Jerry

    Thanks Mike

    Jetli Constant Thing In World Is Change.

    .NET (Core and Framework) csharp visual-studio question

  • Visual studio 2005 installation question
    J Jetli Jerry

    Hello all, This question may be silli, but i m not fully aware of VS.NET versions neither .net. I am about to install Visual Studio 2005, i m having XP machine with VS6. I have been told that u need vs2002 and vs2005 for codes!! 1. does code in VS2002 can work on VS2005? 2. do i need to install vs2002 first then vs2005.? 3. vs2003 needed? 4. then vs6 will work? Thanks in advance

    Jetli Constant Thing In World Is Change.

    .NET (Core and Framework) csharp visual-studio question

  • How many people here still develop apps in Win32 with C/C++?
    J Jetli Jerry

    I am too Sometimes MFC, Jetli Constant Thing In World Is Change.

    The Lounge c++ json question

  • MultiByteToWideChar
    J Jetli Jerry

    tanarnelinistit wrote:

    // Convert the ANSI data to Unicode LPTSTR lpszBuffer = LPTSTR(_alloca((dwBytesRead+1)*sizeof(TCHAR))); MultiByteToWideChar(CP_ACP, 0, szBuffer, strlen(szBuffer), lpszBuffer, sizeof(lpszBuffer)+1);

    I think you need to use WCHAR instead of LPTSTR and for sizeof(TCHAR) use sizeof(WCHAR) hope this helps Jetli Constant Thing In World Is Change.

    C / C++ / MFC com help announcement workspace

  • Days off (JOTD)
    J Jetli Jerry

    Really gGood One.... Jetli Constant Thing In World Is Change.

    The Lounge asp-net com question

  • IP Address
    J Jetli Jerry

    Thats True Many thanks Gavin. :-D Jetli Constant Thing In World Is Change.

    C / C++ / MFC question

  • IP Address
    J Jetli Jerry

    Hi, This works for me, CString sLocalIp; HOSTENT *hs = NULL; UCHAR ch[4] = {0}; CHAR szHostName[50]={0}; // get name of machine if ( SOCKET_ERROR == ::gethostname((LPSTR)(LPCTSTR)szHostName, 50) ) { return GetLastError(); } hs = gethostbyname((LPSTR)(LPCTSTR)szHostName); if ( hs == NULL ) { return GetLastError(); } // h_addr contains ip address memcpy(ch, hs->h_addr,4); // form string sLocalIp.Format("%d.%d.%d.%d", ch[0], ch[1], ch[2], ch[3]); Hope this is also correct method.(((??))) Jetli Constant Thing In World Is Change.

    C / C++ / MFC question

  • UNICODE STRING IN one col of LISTCTRL
    J Jetli Jerry

    Many thanks. I will look for that. Jetli Constant Thing In World Is Change.

    C / C++ / MFC question

  • UNICODE STRING IN one col of LISTCTRL
    J Jetli Jerry

    Many thanks for valuable reply. Mark Petrik Sosa wrote: If your really want to save every character you can and only want that column's strings in Unicode you can try a combination of LVS_OWNERDATA and LVS_OWNERDRAWFIXED to manage your own strings and drawing. Can u spread more lights on this.... Any sample how to do this.... And also after doing some look-search i found that if i call directly SendMessageW(). in that we pass Unicode params... i want to know whcih message internally passed when we call BOOL CListCtrl::SetItemText( int nItem, int nSubItem, LPTSTR lpszText ); Can this be done like this??? Thanks in advance. Jetli Constant Thing In World Is Change.

    C / C++ / MFC question

  • UNICODE STRING IN one col of LISTCTRL
    J Jetli Jerry

    Hi all, I want have DLG application, which is not compiled with _UNICODE ( means it is not UNICODE ,right?). In that I am having one list control to display certaing strings. In perticular, I want to display strings in UNICODE (WCHAR) in say 2nd col of list ctrl for all rows, Is it possible to do this anyhow? Without compiling application to as unicode!!! Any suggestion? Jetli Constant Thing In World Is Change.

    C / C++ / MFC question

  • Cganging Dialog Box Color
    J Jetli Jerry

    Override OnEraseBkgnd(CDC* pDC) E.g. #define DLG_BACK_COLOR RGB(255,0,0) BOOL CYourDlg::OnEraseBkgnd(CDC* pDC) { CRect rect; GetClientRect(&rect); CBrush brush(DLG_BACK_COLOR); pDC->FillRect(rect,&brush); return TRUE; } HTH Jetli Constant Thing In World Is Change.

    C / C++ / MFC c++ tutorial

  • CListCtrl
    J Jetli Jerry

    m_listControlVariable.EnableWindow(TRUE); Jetli Constant Thing In World Is Change.

    C / C++ / MFC design tutorial

  • HWND from hProcess
    J Jetli Jerry

    Hi all, I have dll(mfc) which displays dialog with list control with some file [with path] ( .doc,.msg, ... ) When user double clicks my code opens file in maximize mode useing ShellExecuteEx. It returns me HANDLE hProcess. All works fine. But some file like msg file are not opening in MAXIMIZE state. After looking deep into that i conclude that it is handled by MS Outlook.( means if last msg file is opend in normal window (not maximized) then my code will not open msg file maximized!!.) So what i want is HWND from hProcess. so that i can send message to that window for maximize!!! I have searched a lot and also applied a code. but i think my dll handles this so i m not getting required results. //////////////////////////////////// hProcess is returned by ShellExecuteEx WaitForInputIdle(hProcess,1000); FILETIME lpCreationTime, lpCreationTime2; FILETIME d1,d2,d3; DWORD dwProcessId; HANDLE hProc; GetProcessTimes( hProcess, &lpCreationTime, &d1, &d2, &d3 ); HWND hTemp = ::FindWindow(NULL,NULL); while ( hTemp != NULL ) { if ( ::GetParent(hTemp) == NULL ) { ::GetWindowThreadProcessId(hTemp,&dwProcessId); hProc = OpenProcess(PROCESS_QUERY_INFORMATION, 0, dwProcessId); GetProcessTimes( hProc, &lpCreationTime2, &d1, &d2, &d3 ); CloseHandle(hProc); if ( lpCreationTime.dwHighDateTime == lpCreationTime2.dwHighDateTime && lpCreationTime.dwLowDateTime == lpCreationTime2.dwLowDateTime ) { //("Sending Message"); // Never came here ::PostMessage(hTemp,WM_SYSCOMMAND,SC_MAXIMIZE,0); break; } } hTemp = ::GetWindow(hTemp, GW_HWNDNEXT) ; //"looping"); } // i have also tried with EnumWindows and its proc. Can anyone help me in getting solved my problem. Thank in advance. Regards Jetli Constant Thing In World Is Change.

    C / C++ / MFC help c++

  • Cryptography Problem
    J Jetli Jerry

    Hi all, i am developing simple application in VC6 that uses MS CryptoAPI. One component of my application has login dialog which asks user for loginid,password. and i want to generate Public Key & private key pair for that user.( based on ids/password OR Randomly ) then onwards export publicc key to fixed location on remote server. And Other key will be in memory. And when that user logs out of my application.... the private key will be lost. How can i get same private key and public key pair next time when that user logs in.? I have looked around this forum but not found this... Using MS cryptoapi can i get same keypairs on each login for same user? as far as i understood it is not. Am i right? Then on i want to encrypt the message with public key of other users on system. So that the other user can decrypt ( on remote machine ?) the message and read. Thanks in advance. Jetli Constant Thing In World Is Change.

    C / C++ / MFC question sysadmin performance help

  • Automatic scrolling in ListBox
    J Jetli Jerry

    m_list.SetCurSel( m_list.AddString(s) ); will work for u. It will autimatically scroll to last item and will make is selected. Jetli Constant Thing In World Is Change.

    C / C++ / MFC question

  • I'm searching for Visual C++ Books
    J Jetli Jerry

    hi i would suggest Begining Visual C++ 6.0 by Ivor Horton. by WroX ( the big book ) Jetli Constant Thing In World Is Change.

    C / C++ / MFC c++ csharp database visual-studio algorithms

  • CREATE PROCESS
    J Jetli Jerry

    In ShellExecute, make nShowCmd = SW_HIDE..... Use CreateProcess like this STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). "MyChildProcess", // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) hope this helps Jetli Constant Thing In World Is Change.

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups