If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Release Version problem

I wrote a program with configuration being written in the registry.
My debug version is working fine. But release version is not reading from the registry for some items.
So I enabled debugging in the release version. But in the release version when I press F10 it is skipping
some lines! My code for reading from registry follows.

Re: Release Version problem

Originally Posted by shjdr7

Using MessageBox I found the retCode. It is 0xEA. What does it mean?

From MSDN:

Return Value
If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not of type REG_SZ, ERROR_INVALID_DATA is returned. If the method returns ERROR_MORE_DATA, pnChars equals zero, not the required buffer size in bytes.

Re: Release Version problem

Originally Posted by shjdr7

So I enabled debugging in the release version. But in the release version when I press F10 it is skipping
some lines!

That is because you have optimizations turned on. Turn off the optimizations in release mode and rebuild your application if you want to debug a release build and have the source code match the actual instructions that are executed.

Re: Release Version problem

Originally Posted by shjdr7

Thank you. The correct code was
ULONG nChars = sizeof(value);
Why it was working in debug version is surprising me.

You were passing a pointer to an uninitialized variable. In a debug build, the variable's value is initialized to 0, but in a release build the variable really remains uninitialized. It's value will be whatever happened to be last written to that particular piece of memory.

Cheers, D Drmmr

Please put [code][/code] tags around your code to preserve indentation and make it more readable.

As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.