Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
2 ratings:
 5 out of 5     Rate this Document

Floating Point Exception When Calling Borland C++Builder or Delphi DLL or Executable

Primary Software: Measurement Studio
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: I get a Floating Point Exception when code I wrote in Borland C++Builder or Delphi calls Measurement Studio functions.

Solution: It is hard for National Instruments to meet the standards of every compiler. Most compilers suppress floating point exceptions. Borland C++Builder and Delphi do not suppress them. It is easy to turn this option off in both C++Builder and Delphi.

Here is how to turn them off in C++Builder:

#include float.h

__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
_control87(MCW_EM, MCW_EM);
}

Here is how to turn them off in Delphi:

const
MCW_EM = DWord($133f);
begin
Set8087CW(MCW_EM);
end;

You can set these right before you call into Measurement Studio functions and then undo them afterwards.

Related Links: Turning off Floating Point Exceptions in BCB and Delphi

Attachments:





Report Date: 12/20/2005
Last Updated: 08/25/2006
Document ID: 3SJA58DR

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit