My program runs fine in debug mode. When running a release build, I get following message:

Unhandled exception in prog.exe (MFC42.DLL):
0xC0000005: Access violation

Can someone tell me what might cause this behavior? I am using VC++ 5.0 Pro w SP3