Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2004

Tip: Looking for answers? Try searching our database.

R6002 "floating point not loaded" in Managed C++ DLL that links with LIBCMTD.LIB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Whitney Kew - 18 Apr 2004 05:52 GMT
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::ostringstream inside my managed code.
My code is the following:

float fp = 1.23f;
std::ostringstream os;
os << fp;  // CRASH here

Stepping into the std::ostringstream 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
DotNetJunkies User - 28 May 2004 16:31 GMT
I had a similar problem with a MS C++ (Ver 6) Win32 DLL which handles printout.
I realised that nowhere in the DLL is any floating point arith carried out, its all string handling but does use vsprintf
I forced it by making the dll entry point use floating point
eg:
BOOL APIENTRY DllMain(
HANDLE hMod,DWORD call_reason,LPVOID lpReserved)
{  double val;
  val=17.5;
  return TRUE;
}
Hope this helps
Roger Welby

---

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.