Parkzone

I converted a fairly large project from VC6 to 2005 (VC8). I now find a weird error in release mode when I call CString.Format("%.1f%%", ((double)i * 100.0) / count);.

I have tried adding floating point outside the format string and moving the float computation outside of the format string with no succcess. I am at a loss about where to go from here. The program uses floating point in many other places but it still tells me that the floating point libraries aren't available.

Any Ideas out there



Re: Visual C++ General R6002 Runtime error only in release mode

Jonathan Caves - MSFT

Strange: the workarounds you suggest are the usual workarounds for this problem. This KB article describes the problem:

http://support.microsoft.com/kb/37507

I would try doing a complete rebuild after moving the computation outside of the function call.






Re: Visual C++ General R6002 Runtime error only in release mode

Parkzone

The complete rebuild doesn't help. This is a project that worked with VC6. It appears to be something new with 2005. The problem should have shown up in VC6. Something else is going on here.





Re: Visual C++ General R6002 Runtime error only in release mode

Ramkrishna Pawar

Okay, it could be a problem with CString variable, can you post some code about how it is defined and initialized etc.

You can also try using sprintf_s function to format the double value into a char array and then assign it to CString (see if assignment works).






Re: Visual C++ General R6002 Runtime error only in release mode

Parkzone

I just went through all my code and replaced the Format with _fcvt. It works. There is nothing special about the way I declare the cstring.

CString progress;
progress.Format("%.1f%%", ((double)i * 100.0) / count);





Re: Visual C++ General R6002 Runtime error only in release mode

Parkzone

I was able to find the root cause of the problem. This program had been hacked to remove our dongle protection so we were forced to encrypt the executable with Telock. I don't know why Telock and the new compiler causes the problem but when I remove Telock the problem goes away. Nothing else changed. I guess I will have to find a new encrypter.