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
H

Hari Krishnan Noida

@Hari Krishnan Noida
About
Posts
24
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • can not access the calss view????
    H Hari Krishnan Noida

    Please check the following link for the solution http://www.codeproject.com/script/comments/forums.asp?forumid=1647&mode=all&userid=161454&select=491032&df=100&fr=16230.5#xx491032xx

    C / C++ / MFC help question workspace

  • Check if file existe, get temporary file name?
    H Hari Krishnan Noida

    Hi, 1. Check File exists CFileFind chkFileExistence; if(chkFileExistence.FindFile(strFileName)) { //File exists }else{ //File does not exists } 2. Creating Temporary File Name You can use different methods to create a temporary file name. My suggestion, try to create a file name with Date & Time. Hope this helps. regards ~Hari~

    C / C++ / MFC tutorial question

  • Opening folders
    H Hari Krishnan Noida

    Hi, Try the following code, it will open the specified folder in explorer. void UserDialog::OnButtonClicked() { ShellExecute(GetSafeHwnd (), "open", "C:\\dave\\folder", NULL, NULL, SW_SHOWNORMAL); } regards ~Hari~

    C / C++ / MFC question tutorial

  • Memory leak detection... the best solution?
    H Hari Krishnan Noida

    Hi, Its not MFC. Basically, it uses _CRT... Functions/Flags only. But the thing is, CMemoryState is declared & defined AFX.H/AFXMEM.cpp respectively. Just have a look at the code, if possible write your own. Hope this helps.

    C / C++ / MFC c++ performance question

  • Memory leak detection... the best solution?
    H Hari Krishnan Noida

    Hi, http://www.codeproject.com/script/comments/forums.asp?msg=491851&forumid=1647&mode=all&userid=161454#xx491851xx ----------------------------------------------------------- Hi, Regarding the technique of dumping in-memory statistics, is given below Note: memstate1 takes snapshot of pre-memory leak and memstate2 takes snapshot of post-memory leak. finally, memstate3 makes the statistics based on both the snapshots. CMemoryState memState1, memState2, memState3; void CHello::MakeMemoryLeak() { memState1.Checkpoint(); LPCTSTR strMemoryLeak = new char[50]; memState2.Checkpoint(); memState3.Difference(memState1, memState2); memState3.DumpStatistics(); } Hope this Helps Regards ~Hari~

    C / C++ / MFC c++ performance question

  • CFile trouble
    H Hari Krishnan Noida

    Hi, use "CFile::modeCreate" mode. It will truncate the file to 0, if the file is already exists(overwrite). Otherwise, it will create a new file. Hope this helps regards ~Hari~

    C / C++ / MFC question

  • How to locate an adress to write in a file?
    H Hari Krishnan Noida

    Hi, do you mean "Append"? regards ~Hari~

    C / C++ / MFC tutorial question

  • NM_RCLICK
    H Hari Krishnan Noida

    Hi, For Left Mouse Button, it is just NM_CLICK. regards ~Hari~

    C / C++ / MFC database question

  • How to delete a single line in a text file?
    H Hari Krishnan Noida

    Hi, consider CStdioFile::ReadString(It reads single line) and use intermediate buffer to write. Hope this Helps. regards ~Hari~

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

  • How to change the MFC icon
    H Hari Krishnan Noida

    Hi, Here is the way to change the icon programmatically, CSomeApp::InitInstance() { ... ... pMainFrame->ShowWindow(m_nCmdShow); pMainFrame->UpdateWindow(); HICON hIcon = LoadIcon(IDR_CHANGED); pMainFrame->SetIcon(hIcon, TRUE); pMainFrame->SetIcon(hIcon, FALSE); } regards ~Hari~

    C / C++ / MFC c++ tutorial

  • center text in title bar of app.
    H Hari Krishnan Noida

    Hi, As, other members were suggested, its bit of complex coding. If you really want to do it, here is the link, and download "C++0697.exe" http://www.microsoft.com/msj/0697/c0697.aspx regards ~Hari~

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

  • center text in title bar of app.
    H Hari Krishnan Noida

    Hi, there was a working code on the net called "shadcap", originally written by "Paul DiLascia", Q&A author of MSJ Magaizine. Please search it on the net. Actually, I downloaded the code, just few days back. I couldnt find the link now. Please search it on the net. Otherwise, I can send u the code.

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

  • Memory Leak
    H Hari Krishnan Noida

    Hi David, if you see the memory contents of (pStrWord), it contains 5 (CD - valid memory allocated) and 4 FD(padded memory, # may differ) (Note: Assume that nStrLength is 5) Following code lines, are writing on unallocated memory. pStrWord[nWordIndex++] = ' '; //This causes the problem. pStrWord[nWordIndex] = '\0'; _tcscat(pStrFinal,_tcsrev(pStrWord)); as well, pStrFinal = _tcsrev(pStrFinal); //This assignment also causes the problem. Actually, he has to allocate the extra one byte of memory to put the space character (' '). Hopefully, I am right. regards ~Hari~

    C / C++ / MFC c++ performance help tutorial

  • Memory Leak
    H Hari Krishnan Noida

    Hi, Regarding the technique of dumping in-memory statistics, is given below Note: memstate1 takes snapshot of pre-memory leak and memstate2 takes snapshot of post-memory leak. finally, memstate3 makes the statistics based on both the snapshots. CMemoryState memState1, memState2, memState3; void CHello::MakeMemoryLeak() { memState1.Checkpoint(); LPCTSTR strMemoryLeak = new char[50]; memState2.Checkpoint(); memState3.Difference(memState1, memState2); memState3.DumpStatistics(); } Hope this Helps Regards ~Hari~

    C / C++ / MFC c++ performance help tutorial

  • Can someone help, im new to C++
    H Hari Krishnan Noida

    Hi, Try with following code snippet. ---------------------------------------------------------- :)CString strSentence = "a do cat from hello thomas d"; int iLongest = 0; //Initialize with minimum value. int iShortest = 1024; //Initialize with Big Value int nIndex; //Backup. If you dont want you can remove CString strHelper(strSentence); while(!strHelper.IsEmpty()) { if(-1 == (nIndex = strHelper.Find(' ', 0))) { nIndex = strHelper.GetLength(); //Last word strHelper.Empty(); } if(nIndex < iShortest) iShortest = nIndex; if(nIndex > iLongest) iLongest = nIndex; strHelper.Delete(0, nIndex+1); //Remove including space. } ----------------------------------------------------------

    C / C++ / MFC help c++ java question learning

  • CFile
    H Hari Krishnan Noida

    Hi, As, franks mentioned, it happens because, the output is not null-terminated. Here's the code snippet, which very well read your file, without any memory leaks. ----------------------------------------------------------- CFile oFile; DWORD dwFileLength; if(oFile.Open("F:\\test\\id.txt", CFile::modeRead)) { try { CString strBuffer; dwFileLength = oFile.GetLength(); LPTSTR szBuffer = strBuffer.GetBufferSetLength(dwFileLength); oFile.Read((LPVOID)szBuffer, dwFileLength); oFile.Close(); CString csPath(strBuffer); strBuffer.ReleaseBuffer(); } catch(CFileException *e) { AfxMessageBox ("Error!"); e->Delete(); } } ----------------------------------------------------------- regards ~Hari~

    C / C++ / MFC help question

  • Why have my Classes disappeared?
    H Hari Krishnan Noida

    Hi, The .ncb file contains ClassView browser information. I believe, some of your .ncb(if you're using multiple projects) file permission may have changed. That is the cause. To check that, create a sample program and change .ncb file to read-only. Now you reload the project, you will not be able to see any classes in the classview. Hope this helps, if not better you move all your .ncb files to some other location. so that your .dsw/.dsp will recreate your class view again. regards ~Hari~

    C / C++ / MFC question workspace

  • dynamic creation of buttons and tooltips?
    H Hari Krishnan Noida

    Hi, You need to relayevent to the tooltip control. Otherwise, how tooltip control will know when & where to show what? Also, whether you are using CTooltipCtrl? If so, then you have to add some more stuff also like addtool, etc.. regards ~Hari~

    C / C++ / MFC help question

  • How to delete entire row in CListCtrl?
    H Hari Krishnan Noida

    Hi, You do the following, m_LCtrlPtr->DeleteItem(m_LCtrlPtr->GetSelectionMark()); This will delete the currently selected item in the list control. GetSelectionMark() is to retrieve the currently selected item. hope this helps!! regards ~Hari~

    C / C++ / MFC database tutorial question

  • Execution problem with TrackPopupMenu, help !!!
    H Hari Krishnan Noida

    Hi, do the following things, 1. Declare CMenu Variable as a member variable 2. Load the menu, during initialization. 3. And, try now, it should work. regards ~Hari~

    C / C++ / MFC help c++ graphics
  • Login

  • Don't have an account? Register

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