S
Saurabh Aggrawal
Hi,
I have made a dll and it is working fine in the debug build (as
expected) but when I run it in the release build it is working
strangely.
For example, the dll saves the 10 properties on the exit to a .txt file
and when it get loaded again these properties are read from the text
file and shown on the user interface.
Dll can save the values to the text file correctly for both debug and
release builds.
But the dll could not read the values of these properties in the
release build somehow. Btw it is reading values fine in debug build.
So let say I have 10 properties namely... A, B, C, D, E, F, G,H, I ,J
then I could read A B C D F G I J from the text file but others are
lost in the way.
One unique thing I have observed is that adding a pointer in the code:
wchar_t str[256];
solves this problem. I am not using "str" anywhere in the code.
I have initialized the variables properly and also done the alignment
of the structures "#pragma pack(8)". I tested the code on prefast and
no errors are there. I have also turned of the optimizer.
The only way I am able to run the Dll correctly without adding this
variable is by keeping the debug information in the Release Dll. I
don't want to keep the debug information in the release dll as it is
increasing the size of the dll.
Could you please suggest me the reason for this strange behavior?
Respects,
Saurabh Aggrawal
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
I have made a dll and it is working fine in the debug build (as
expected) but when I run it in the release build it is working
strangely.
For example, the dll saves the 10 properties on the exit to a .txt file
and when it get loaded again these properties are read from the text
file and shown on the user interface.
Dll can save the values to the text file correctly for both debug and
release builds.
But the dll could not read the values of these properties in the
release build somehow. Btw it is reading values fine in debug build.
So let say I have 10 properties namely... A, B, C, D, E, F, G,H, I ,J
then I could read A B C D F G I J from the text file but others are
lost in the way.
One unique thing I have observed is that adding a pointer in the code:
wchar_t str[256];
solves this problem. I am not using "str" anywhere in the code.
I have initialized the variables properly and also done the alignment
of the structures "#pragma pack(8)". I tested the code on prefast and
no errors are there. I have also turned of the optimizer.
The only way I am able to run the Dll correctly without adding this
variable is by keeping the debug information in the Release Dll. I
don't want to keep the debug information in the release dll as it is
increasing the size of the dll.
Could you please suggest me the reason for this strange behavior?
Respects,
Saurabh Aggrawal
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]