How to Find the Source of Memory Leaks

When you run your (unmanaged/C++) application in debugger, you see at the end a report of memory leaks (if any are detected). Something like this: Detected memory leaks! Dumping objects -> f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {381} normal block at 0x001FFC30, 54 bytes long. Data: < x > 0C 00 B9 78 12 00 00 00 12 00…

VSBuildStatusAddin for Visual Studio 2005

I have modified my VSBuildStatus add-in to work with Visual Studio 2005. Basically I had to remove the LINQ stuff to break the dependency on the version 3.5 of the .NET framework. The new version (1.0.3) that supports Visual Studio 2005 is available here. Let me know if you have any problems with it. Especially…

50917 errors

This is the record number of error I ever got in a project: 50917. After compiling that VC# project (with T4), Visual Studio 2008 was a little bit overwhelmed. It started to report out of memory errors and failed to build after fixing the error. A restart was, of course, the cure.

File Dialogs in MFC 9.0

Windows Vista redesigned the way the file dialogs look. MFC 9.0 (that will ship with Visual Studio 2008) was updated to support the new look and feel. If you compile your MFC application with VS 2008 you get the new file dialogs with no additional change. On the other hand if you run the application…

Debugging and Exception Handling

Suppose you have the following code:

When running the program, the following window is popped up: When running it in the debugger, a different window is popped up: and the debugger takes you to the line of code that threw the exception. Looking into the output window, you can see something like this: First-chance…

Resource Header Problem in Orcas March CTP

In a previous post I explained than when you create a MFC application with the March CTP of ‘Orcas’ and add a command or split button to a dialog, the .rc file is not compiled, because styles such as BS_COMMANDLINK are not found. My workaround for the moment was to redeclare them in the resource.h…