W
Whitney Kew
Hello everyone,
I'm developing a mixed-mode Managed C++ DLL using .NET 2003, and to
avoid the potential mixed-DLL-loading-deadlock issue discussed in MS
KB article 814472 (http://support.microsoft.com/?id=814472), I've
followed the steps in that article appropriately. However, our
application will have to support multiple versions of the Win OS, and
we don't want to run into possible DLL Hell problems with the C
Runtime DLLs. So, it's been decided that we need to link with the
static version of the CRT, LIBCMT(D).LIB, instead of MSVCRT(D).LIB.
Unfortunately, now that we're linking with LIBCMTD.LIB, I'm now
getting a Runtime Error, R6002, "floating point not loaded" when I try
to insert a float into a std:stringstream inside my managed code.
My code is the following:
float fp = 1.23f;
std:stringstream os;
os << fp; // CRASH here
Stepping into the std:stringstream innards, the crash occurs at a
::sprintf() call inside the system file "xlocnum" inside a method
called num_put<>::do_put(). I've done some searching around and tried
playing with a _fltused variable, _fpreset(), _fpmath(), all to no
avail.
Could someone help me out with this? Thanks very much in advance!!
Whitney Kew
Software Engineer
Rain Bird Corporation
http://www.rainbird.com
I'm developing a mixed-mode Managed C++ DLL using .NET 2003, and to
avoid the potential mixed-DLL-loading-deadlock issue discussed in MS
KB article 814472 (http://support.microsoft.com/?id=814472), I've
followed the steps in that article appropriately. However, our
application will have to support multiple versions of the Win OS, and
we don't want to run into possible DLL Hell problems with the C
Runtime DLLs. So, it's been decided that we need to link with the
static version of the CRT, LIBCMT(D).LIB, instead of MSVCRT(D).LIB.
Unfortunately, now that we're linking with LIBCMTD.LIB, I'm now
getting a Runtime Error, R6002, "floating point not loaded" when I try
to insert a float into a std:stringstream inside my managed code.
My code is the following:
float fp = 1.23f;
std:stringstream os;
os << fp; // CRASH here
Stepping into the std:stringstream innards, the crash occurs at a
::sprintf() call inside the system file "xlocnum" inside a method
called num_put<>::do_put(). I've done some searching around and tried
playing with a _fltused variable, _fpreset(), _fpmath(), all to no
avail.
Could someone help me out with this? Thanks very much in advance!!
Whitney Kew
Software Engineer
Rain Bird Corporation
http://www.rainbird.com