visual studio .net general:
Hi,
I will do some historic about my project. It's a EXE MFC project, with ATL,
and some managed class (compiled with /clr) It was create in VC++ 6.0 (or
5.0). 2 years ago, we convert it to VS2003, and it work fine, after fix some
error and warning. Now we try to convert it to VS2005.
The project compile fine. When we started it, it crashed before any
initialition in the exe (constructor of CWinApp). I think it crash when it
try to load the exe. Here is the crash output :
First-chance exception at 0x7c81eb33 in Application.exe: Microsoft C++
exception: EETypeLoadException at memory location 0x0030e68c..
First-chance exception at 0x7c81eb33 in Application.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c81eb33 in Application.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c81eb33 in Application.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..
An unhandled exception of type 'System.IO.FileLoadException' occurred in
Unknown Module.
I searched alot to find solution without any working solution. Then i try to
create a new project in VS2005, and move file one by one from the old project
to the new one. I test the new project each time i add 10-12 files. After
alot of files, it finally crashed... The problem is cause by the string
constant. In my new file, i have many lines like this (I have around 30 in my
cpp file) :
strOutPut.Format(_T("%.2f"),depth);
If i comment anyone of this lines, the software dont crash. Then i comment
all the code in the file.. then i put this line 25 times in the constructor
in the same file and it crashed. I try to put this 25 lines in another file,
and it crashed again. But if i do something like :
TCHAR* ttt = _T("%.2f");
strOutPut.Format(ttt, depth); x 25 times (and 50 times too)
It work fine!!! Then i supose that the problem was that they are too many
string (maybe any kind of) constant in my project!!?! Is exist any project
setting to allow more constant?!
I see "Enable String Pooling" in the setting, but this option is for the
same string.. In my test (and example), i use the same string (25 times
_T("%.2f") ) But in my real code, most of the string are different!
Any help will be appreciate!
thanks