I started learned windbg and I found this good post How to use WinDbg to analyze the crash dump for VC++ application?
Now I want to follow the instructions and do it
This will produce a null pointer dereference exception:
*((int*) 0) = 0;
This will produce integer division by zero:
int a = 0; int b = 5 / a;
EDIT: Post-Mortem Debugging Your Application with Minidumps and Visual Studio .NET contains a lot of sample code and theory on using minidumps.
Most of the times you will find all apps dump in C:\windows\minidumps.
To generate a dump file you could use a simple solution:
or
This way you will be able to analyze that crash anytime :)
Auto minidump generation is done by the post-mortem debugger, so you need to start there. Most importantly though, it's done by a debugger. So if you just want to generate a minidump, you can use your typical debugger (probably visual studio or windbg). Even task manager can create dump files.
The registry setting which specifies the post-mortem debugger is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
Look at the Debugger
string, and you will be on your way to finding your minidumps.