Hi Rob & everyone

I'm still trying to get rid of this Invalid floating point operation exception 
in a DLL that I'm loading.

Please excuse the HTML formatting in this email but it is due to the 
requirement that the next diagram is in a non-variable font.

 F E D C B A 9 8 7 6 5 4 3 2 1 0 
       | | | | | |   | | | | | | 
       | | | | | |   | | | | | +-- invalid operation mask 
       | | | | | |   | | | | +---- denormalized operand mask 
       | | | | | |   | | | +------ zero divide mask 
       | | | | | |   | | +-------- overflow mask 
       | | | | | |   | +---------- underflow mask 
       | | | | | |   +------------ precision mask 
       | | | | | | 
       | | | | | +---------------- interrupt enable/disable 
       | | | | |                   0 = enabled; 1 = disabled 
       | | | | | 
       | | | +-+------------------ precision control 
       | | |                       00 = 24 bits; 01 = reserved 
       | | |                       10 = 53 bits; 11 = 64 bits 
       | | | 
       | +-+---------------------- rounding control 
       |                           00 = round to nearest or even 
       |                           01 = round towards -infinity 
       |                           10 = round towards +infinity 
       |                           11 = truncate towards zero 
       | 
       +-------------------------- infinity control 
                                   0 = projective; 1 = affine 
                                   (8087/80287 only) 

The default Delphi control word is apparently $1332, though mine is different 
to this.

Based on the diagram I tried changing the control word (in my app which loads 
the DLL dynamically) to $13B5.  This should mask all the 6 possible exceptions, 
but this made no difference at all.

It seems odd to me that the error can occur just by moving the mouse over the 
form that the DLL draws.  And the fact that the error is occuring in MSVCRT.DLL 
would suggest some visual problem.  Here is an excerpt from MadExcept which may 
provide some clues.

exception class   : EInvalidOp
exception message : Invalid floating point operation.

main thread ($c90):
77c4fa29 msvcrt.dll            _ftol
77d6e56c user32.dll            DefDlgProcA
77d496c2 user32.dll            DispatchMessageA
0047a183 SPLEngine.exe Forms   TApplication.ProcessMessage

Does anyone have any further ideas to stop or ignore the exception.  It's not a 
fatal exception since I can click OK several times on the message and it 
disappears and continues working correctly.

Many thanks,
Ross.

----- Original Message ----- 
From: "Rob Kennedy" <[EMAIL PROTECTED]>
To: "Borland's Delphi Discussion List" <[email protected]>
Sent: Thursday, October 27, 2005 5:00 AM
Subject: Re: Trapping Errors in DLL's again


Ross Levis wrote:
> What is interesting is that the error doesn't occur when the plugin is
> used in Winamp.  So Winamp must be able to somehow ignore the error,
> which is probably why the plugin developers do not realize there is a
> bug their DLLs, and why I'm having so many problems!

Since what you're getting are floating-point errors, it may be that the
DLL expects floating-point exceptions to be disabled. You can do that by
setting the FPU control word. I don't know how to do that, offhand, so see
whether any messages at the link below show you how to disable FPU
exceptions.

http://groups.google.com/groups?q=FPU+control+word+exception+group%3A*delphi*

-- 
Rob


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to