How to create minidump for my process when it crashes? How to create minidump for my process when it crashes? windows windows

How to create minidump for my process when it crashes?


You need to programatically create a minidump (with one exception, see next link). CodeProject has a nice article on MiniDumps. Basically, you want to use dbghelp.dll, and use the function MiniDumpWriteDump() (see MSDN on MiniDumpWriteDump).

How effective such dumps are depends very much on the application. Sometimes, for optimized binaries, they are practically useless. Also, without experience, heap/stack corruption bugs will lead you astray.

However, if the optimizer was not too hard on you, there is a large class of errors where the dumps do help, namely all the bugs where having a stack-trace + values of the locally used variables is useful, i.e. many pure-virtual-function call things (i.e. wrong destruction order), access violations (uninitialized accessed or missing NULL checks), etc.

BTW, if your maintenance policy somehow allows it, port your application from VC6 to something acceptable, like VC8 or 9. You'll do yourself a big favor.


Thanks all for viewing and replying special thanks to gimpf, I googled on internet and msdn.

I found an excellent article on debugInfo.com This is worth to read :

effective minidumps


We use Google Breakpad in Firefox, although that requires at least Visual C++ 2003. The nice side benefit is that it also supports OS X and Linux.