Release build problem...
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I have a C++ dll(No MFC) in release mode. In the initialization process I read some environment variables and copy them to string variables(members of MyClass). Strangely the values are not copied to the string members. When I debugged the code(release version), the address of this pointer in the constructor of MyClass changes with each line of code!! MyClass::MyClass { ... char* szEnv; szEnv = getenv("CONFIG_PATH"); // Environment variable m_sConfigPath = string(szEnv); // m_sConfigPath is a member variable of MyClass of type string(STL) ... } For testing purpose, I tried this char szBuff[100]; strcpy(szBuff,"Hello!"); Even this failed! Can anybody help me out? Note: Everything works fine in debug mode. Thanx, Jagadish.