Explicitly initialize DWORD to 1, but debugger shows wildly out of range value

Your code is more than likely optimized. This means that the compiler has moved and eliminated code in a way that your source code does not match what the compiler has produced.

Either debug unoptimized code, or debug optimized code with the full knowledge that the source may not match the actual instructions being performed.

If you want to debug a release build but see the correct values in the debugger, go to the Properties of your project in Visual Studio, go to the C/C++ section, and disable the optimizations. Rebuild.

Leave a Comment