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
K

kasturi_haribabu

@kasturi_haribabu
About
Posts
35
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MFC application crashes @ ConnectionTransact of DBNMPNTW.DLL
    K kasturi_haribabu

    Do mean the Connect takes a long time before it crashes? if yes, the problem may be with authentication or with the sever not able to connect to your applications and the exception is not handled.

    C / C++ / MFC c++ database data-structures

  • making c++ stop and restart functuin at specific time
    K kasturi_haribabu

    use GetSystemTime and GetLocaltime functions instead . gettick count and determining the Actual time may not me precise. haribabu

    C / C++ / MFC tutorial c++ algorithms question

  • Identifying a corrupt exe
    K kasturi_haribabu

    Although there is no Direct way to do this, letme specify some alternatives. 1. calculate the Check sum of the File before you save and validate it after your file copy operation is complete. (Less Error prone but effective) 2.Verify the Size of the file copied. haribabu

    C / C++ / MFC adobe question

  • How to spawn CDialog by CWinThread?
    K kasturi_haribabu

    Dear, You need not take that much pain to accomplish this. If all you need to inform is a count and some other simple parameters, why dont you put them in the APP, and once you got the parameters from the dialog, AfxGetAPP(), update / set variables and then... your task is done... regards, haribabu

    C / C++ / MFC question c++ help tutorial

  • Track other processes in the computer
    K kasturi_haribabu

    Pls Find answer to your code.... I dont know how i can attach a file to code project message. there fore please copy from the message... /* Header File for the Class /* #include "stdafx.h" #include "psapi.h" #pragma pack(16) #define FOUND_WJRU 0 #define WJRU_NOTFOUND 1 class CProcessMonitor { private: DWORD mAvailableProcesses[1024], cbNeeded, cProcesses; public: UINT getTotalAvailableProcesses(); UINT getProcessTimes(); BOOL FindProcessandMemoryDetails(DWORD processID,CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters); BOOL IsProcessMatchingNameAndID( DWORD processID, UINT index ); HANDLE GetProcessHandle(DWORD processID, CString Processname); HANDLE GetHandleToProcess(CString Processname); void GetJRUStatus(int&nStatus, PROCESS_MEMORY_COUNTERS& psMemInfo); }; #pragma pack() /// CPLUSS PLUS FILE.... #include "stdafx.h" #include "psapi.h" #include "EnumProcess.h" BOOL CProcessMonitor::IsProcessMatchingNameAndID( DWORD processID, UINT index ) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH] = "Wjru.exe"; PROCESS_MEMORY_COUNTERS psmemCounters; // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hProcess ) { HMODULE hMod; DWORD cbNeeded; if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod), &cbNeeded) ) { GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName) ); if(strcmp(szProcessName,szTargetProcessName) ==0) { GetProcessMemoryInfo(hProcess,&psmemCounters,sizeof(PROCESS_MEMORY_COUNTERS)); return TRUE; } else { return FALSE; } } } return FALSE; } BOOL CProcessMonitor::FindProcessandMemoryDetails(DWORD processID, CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH]; strcpy(szTargetProcessName,Processname.GetBuffer(50)); Processname.ReleaseBuffer(); // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hPro

    C / C++ / MFC c++ question

  • Primary Domain Controller Name and local workstation Name??
    K kasturi_haribabu

    Dear umar cool, Please find code for your question ....Thanks for giving me a good question to answer... Senior guys... Please forgive me if I wrote a stupid code.... int EnumAllComputers() { LPSERVER_INFO_101 pBuf = NULL; LPSERVER_INFO_101 pTmpBuf; DWORD dwLevel = 101; DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH; DWORD dwEntriesRead = 0; DWORD dwTotalEntries = 0; DWORD dwTotalCount = 0; DWORD dwServerType = SV_TYPE_SERVER; // all servers DWORD dwResumeHandle = 0; NET_API_STATUS nStatus; LPTSTR pszServerName = NULL; DWORD i; // // Call the NetServerEnum function to retrieve information // for all servers, specifying information level 101. // nStatus = NetServerEnum((LPCSTR)pszServerName, dwLevel, (LPBYTE *) &pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries, dwServerType, NULL, &dwResumeHandle); // // If the call succeeds, // if ((nStatus == NERR_Success) || (nStatus == ERROR_MORE_DATA)) { if ((pTmpBuf = pBuf) != NULL) { // // Loop through the entries and // print the data for all server types. // for (i = 0; i < dwEntriesRead; i++) { assert(pTmpBuf != NULL); if (pTmpBuf == NULL) { fprintf(stderr, "An access violation has occurred\n"); break; } //printf("\tPlatform: %d\n", pTmpBuf->sv101_platform_id); wprintf(L"\tName: %s\n", pTmpBuf->sv101_name); //printf("\tVersion: %d.%d\n", // pTmpBuf->sv101_version_major, // pTmpBuf->sv101_version_minor); printf("\tType: %d", pTmpBuf->sv101_type); // // Check to see if the server is a domain controller; // if so, identify it as a PDC or a BDC. // /*SV_TYPE_WORKSTATION SV_TYPE_SERVER SV_TYPE_SQLSERVER SV_TYPE_DOMAIN_CTRL SV_TYPE_DOMAIN_BAKCTRL SV_TYPE_TIME_SOURCE SV_TYPE_AFP SV_TYPE_NOVELL SV_TYPE_DOMAIN_MEMBER SV_TYPE_PRINTQ_SERVER SV_TYPE_DIALIN_SERVER SV_TYPE_

    C / C++ / MFC design json question

  • Sockets communication between Internal and external IPs
    K kasturi_haribabu

    A Socket needs an IPAddress to communicate with its another peer. 1. It doesnt care whether it is External (PublicIP) or Internal (LAN)(hope my interpretation of internal and external is right) it is handled by the DNSserver (publicIP) or your LAN GateWay. 2. Once the Connect--listen-- accept sequence is over, you can exchange messages between any two connected sockets. regards, haribabu

    C / C++ / MFC question sysadmin lounge

  • UI-thread with both message pump and an infinite loop
    K kasturi_haribabu

    I think that you also introduce atleast a Sleep(0) after the DispatchMessage statement.

    C / C++ / MFC design tutorial

  • How to keep track of the objects in an editor
    K kasturi_haribabu

    Hello all, I would like to Design and write an application that does the editing of a document (almost like an MS Word, but a with a lot cut down functionality of it). The components of the document can only be known at run time, like adding a text box, adding a Image, field, text, etc.., I Started to design assuming its a simple task, but now I realize its a lot more than what I thought. can any body please help me with some ideas such as how to keep track of objects inserted, with their properties, (of course I can think up to some extent, such as maintaining a list of them along with a lot of attributes)... and maintaining them in a file and reconstructing on a file load... and so on.., but I am curious to know how it is done in a standard industry? are there any standards defined for this purpose.. like how a document (*.doc)is stored? Hope this stupid question is not annoying, Haribabu

    C / C++ / MFC question design help tutorial learning

  • Scale control
    K kasturi_haribabu

    Can any one guide me in writing a scale control for editing applications? I see there is a control in MS word application. But I wonder what it is called? i want to mimic the scale just like it does in MSWORD, but I have no clue how to go about it. haribabu

    C / C++ / MFC tutorial question

  • Getchar and getche problem
    K kasturi_haribabu

    Are you using both the function calls in a sequence? i mean one statement after the other? if Yes, Pressing "Enter" button does mean you are entering \r\n together into the stdin(keyboard) buffer.The first getchar() is returning the "\r". and the second getche() is returning the "\n" . can you test using getchar() once in your function and then, replace the getchar() with getche() and then verify result? regards, haribabu

    C / C++ / MFC help question

  • How to get the format of users local date and time?
    K kasturi_haribabu

    consider using COleDateTime. COleDateTime::Format CString Format( DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT ); haribabu

    C / C++ / MFC c++ tutorial question

  • multithreading
    K kasturi_haribabu

    Answer to your question : Create the two threads by calling Afx begin thread twice. Note before : 1. Both the threads should not share any data / resources. 2. if they share, its quite not possible to run them simultaneously(you can use synchronising techniques, but you will loose the "simultaneous" effect.) regards, haribabu

    C / C++ / MFC help tutorial question

  • Status Pane
    K kasturi_haribabu

    If you call, m_wndStatusBar.SetPaneInfo(0, IDS_MESSAGE, SBPS_STRETCH, len); is program crashing?

    C / C++ / MFC question

  • Status Pane
    K kasturi_haribabu

    I think its strange that one problem persists for such a long time... :sigh: I have some questions for you. 1. Have you used "SetIndicators" function? >> If you are not using function, your prograam will definitely crash. 2. What is the idea behind doing these operations in a DOC class? 3. Is it possible to share the code you are using to create status bars? thanks and regards haribabu

    C / C++ / MFC question

  • hide submenu item on selecting a menu item
    K kasturi_haribabu

    May be this will help you.. //This Code is Written in sub - submenu // Your First Menu. CMenu *mnuPop; // Your Second Menu. CMenu *mnuSubMenu; // Load your menu here... mnuPop->LoadMenu(IDR_THERMATYPE); // Get the Sub Menu handle handle here... mnuSubMenu = mnuPop->GetSubMenu(0); // Disable the Another Submenu from this Sub Menu... mnuSubMenu->EnableMenuItem(ID_EDIT_COPY,MF_BYPOSITION | MF_GRAYED); // Redraw your Menu after this.(only some times needed...

    C / C++ / MFC question

  • MFC STATUS BAR PROBLEM
    K kasturi_haribabu

    I have tried with an and this code works. May be something else is wrong... CString message; message = "A LOOOOOOOOOOOOOOOOOOOOONG MESSAGE000000"; int len = message.GetLength(); m_wndStatusBar.SetPaneText(1,(LPCTSTR)message,FALSE); m_wndStatusBar.SetPaneInfo(1, 1, SBPS_STRETCH, len);

    C / C++ / MFC help question c++ tools

  • Please help, SendMesssage not working in MFC Dialog Application, (with wizard)
    K kasturi_haribabu

    extern CListBox* hList; SendMessage((HWND)hList, LVM_DELETEALLITEMS, 0, 0); (HWND)hList is pointing to a CListBox handle. that means, Message is being sent to the List box. is that what you intend to do? Pass the handle of the MainDialog here..:) regards, Haribabu

    C / C++ / MFC c++ help question

  • hide submenu item on selecting a menu item
    K kasturi_haribabu

    SEE the Sample code.............. :) Please modify the code as per your project. CMenu *mnuPop; mnuPop->LoadMenu(IDR_TASKBAR_MENU); SetForegroundWindow(); CWnd* pWnd = AfxGetMainWnd(); if(pWnd->IsIconic() != 0) // minimized { mnuPop->GetSubMenu(0)->EnableMenuItem(ID_WJRU_WJRU,MF_BYPOSITION | MF_ENABLED); } else { mnuPop->GetSubMenu(0)->EnableMenuItem(ID_WJRU_WJRU, MF_BYPOSITION | MF_GRAYED); }

    C / C++ / MFC question

  • StatusBar Question in MFC
    K kasturi_haribabu

    Use CStatusBar::SetPaneInfo( int nIndex, UINT nID, UINT nStyle, int cxWidth ); :)

    C / C++ / MFC question c++ tools 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