Board index » delphi » Floating point exception when using VC++-DLL

Floating point exception when using VC++-DLL

Hi,

when using a VC++-DLL in a Delphi4 application some
of the imported DLL functions cause floating point exceptions.
Does anybody knows about this phenomen and is there an
existing workaround e.g. changing some compiler settings??

Thanx,

Thomas

 

Re:Floating point exception when using VC++-DLL


Try adjusting the 8087 Control Word (see "Set8087CW" in Delphi Help) to disable
checks for divide by zero or whatever other exceptions.
Some exceptions will still be intercepted by the de{*word*81} though (when running
from the Delphi IDE).

Eric

Re:Floating point exception when using VC++-DLL


Hi,

If you set the controlword to $133f (in code Set8087CW($133f)) then all
exceptions are disabled. I'm not sure this is the way to go though. If you
use exceptions further on in your program it is very hard to say what the
consequences will be. Code after the line that caused the exception IS
processed now and code in the except block isn't, hardly a desired result.

Maybe you need to check the functions in the DLL first. See what they do
when you run them inside your program instead of running them from a DLL.

BTW You restore the controlword as follows Set8087CW(DefaultCW);

Phil,

"Eric Grange" <egra...@infonie.fr> schreef in bericht
news:39E47E4B.9E2D2572@infonie.fr...

Quote
> Try adjusting the 8087 Control Word (see "Set8087CW" in Delphi Help) to
disable
> checks for divide by zero or whatever other exceptions.
> Some exceptions will still be intercepted by the de{*word*81} though (when
running
> from the Delphi IDE).

> Eric

Other Threads