I have previously posted on memory leak in a MFC application - microsoft.public.vc.mfc | Google Groups about a memory leak problem that I had trouble finding and solving. To summarize, the two projects are posted in these two links, although you may not have the required libraries and data files to build or run them properly:

usensimcalc: https://rcpt.yousendit.com/671032497...f59d5fd08a21e6
rendering: https://rcpt.yousendit.com/671035295...f194240615586e

I tried using {,,msvcr80d.dll}_crtBreakAlloc and setting its number to a number printed on the {} brackets in the debug output on the memory leak information on the memory allocation number and memory address. Also the memory allocation number in the {} brackets are different every time I run the splitter project.

As suggested in one of the links in my original post, I tried using CMemoryState objects provided by MFC. Although it confirms that DoNeedle function is responsible for some leak instances, the memory dumping function doesn't tell me enough information that I understand what's happening. Below is how I used the MFC CMemoryState objects:

Code:
		// run the simulation only when the flag is true
		// later, modify it by having a start button message handler modifying its status
		if(startsim && needlemodel)
		{
			theMesh->NodesRepoint(needlemodel->Xall);
			theMesh->nodesdeleteignore = true;		// change this parameter's scope back to private
			startsim = false;
		}

		if (theMesh->nodesdeleteignore && 
			needlemodel)
		{
			if (count < needlemodel->needleBasePos.entries)
			{
#if _DEBUG
				CMemoryState oldstate, newstate, diffstate;
				oldstate.Checkpoint();
#endif
				
				// Note: memory leak indeed comes from this function
				// need to determine the meaning of the memory leak diagnostics
				needlemodel->DoNeedle(&(needlemodel->needleBasePos.nodepts[6*count]));

#if _DEBUG
				newstate.Checkpoint();
				if(diffstate.Difference(oldstate, newstate))
				{
					AfxMessageBox("Memory Leak Detected");
					diffstate.DumpAllObjectsSince();
				}
#endif
According to the last suggestion in the post, I have tried using try catch block to see if exceptions are being caught by the program. Unfortunately, it didn't catch any exceptions from the MFC classes. Below is how I tried to use the try catch block:

Code:
				try
				{
					needlemodel->DoNeedle(&(needlemodel->needleBasePos.nodepts[6*count]));
				}
				catch (CMemoryException* e)
				{
					delete needlemodel;
					exit(1);
				}
				catch (CFileException* e)
				{
					delete needlemodel;
					exit(1);
				}
				catch (CException* e)
				{
					delete needlemodel;
					exit(1);
				}
I'm not sure what other tools I can use to find the sources of the unexpected memory allocation. It would be great to hear some suggestions in terms of more ways of finding sources of memory allocation responsible for memory leaks. Again, I have already done my part to ensure new/delete or malloc/free are paired properly, with splitter (MFC document view application) containing memory leaks and usensimcalc (Windows console application) not containing memory leaks, while DoNeedle function in both projects are run in the exact same way.