On 17 May 2011, at 21:35, Anton Shepelev wrote:

> I have tried to create a Windows plugin dll for the Sylpheed
> e-mail client in FreePascal but couldn't get past a  strange
> side  effect: the mere fact of the plugin being loaded makes
> GTK's window-showing functions crash the whole program.

One likely potential cause is the fact that released FPC versions enable all 
floating point exceptions. Since libc does not do that, many C programs and 
frameworks contain invalid floating point operations.

You can try adding the following to your dll:

uses
 math;

...

initialization
 SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, 
exUnderflow, exPrecision])
end.


Of course, this means that you won't get such exceptions in Pascal code either 
anymore._______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to