Alexander Halser 20 Posted April 21, 2020 I am using TEmbeddedWB (an extended version of TWebBrowser, the "latest" from GitHub from 2011) in a VCL application, where it works just fine. The very same code compiled with 64 bit, however, crashes on some pages/scripts. The crash comes from C:\Windows\System32\jscript9.dll and reads: First chance exception at $00007FFF99D9840. Exception Class $C00000090 with message "c00000090 FLOAT_INVALID_OPERATION' It can be duplicated with a very simple test app in Delphi 10.1 or 10.3. If I use a standard TWebBrowser instead of TEmbeddedWB, it runs fine both as 32 and 64 bit. So I assume it is some declaration issue in one of the old units of TEmbeddedWB, that are not compatible with 64 bit. Any suggestions what to look for in the code? Share this post Link to post
David Heffernan 2293 Posted April 22, 2020 Isn't this just the age old issue that Delphi's RTL unmasks floating point hardware exceptions, but most other tools (including the MS tools) mask them. So the ActiveX control that implements the embedded browser expects floating point hardware exceptions to be masked and is caught out by your host having unmasked them. Resolve the problem in the traditional way by masking floating point hardware exceptions. There are countless SO posts on this subject which will show you how to do this. 4 1 Share this post Link to post
Alexander Halser 20 Posted April 22, 2020 Thank you! This has indeed solved the issue. initialization {$IFDEF WIN64} System.Math.SetExceptionMask(exAllArithmeticExceptions); {$ENDIF} Share this post Link to post
David Heffernan 2293 Posted April 22, 2020 2 hours ago, Alexander Halser said: Thank you! This has indeed solved the issue. initialization {$IFDEF WIN64} System.Math.SetExceptionMask(exAllArithmeticExceptions); {$ENDIF} Do this for both 32 and 64 bit. Just because you might get away with it in 32 bit for now, doesn't mean you always will. And if your app doesn't need floating point exceptions unmasked then mask them. Have consistency between 32 and 64 bit. 2 Share this post Link to post
Attila Kovacs 617 Posted April 22, 2020 20 hours ago, Alexander Halser said: If I use a standard TWebBrowser instead of TEmbeddedWB, it runs fine TWebBrowser is in SHDocVw.pas which has FSetExceptMask(femALLEXCEPT); in the initialization section. I don't know ~WB. Share this post Link to post
Alexander Halser 20 Posted April 22, 2020 Quote TWebBrowser is in SHDocVw.pas which has FSetExceptMask(femALLEXCEPT); That part was missing in the ~WB version. Must have been added in more recent versions of SHDocVw.pas. Share this post Link to post
Joseph MItzen 243 Posted April 23, 2020 23 hours ago, David Heffernan said: Isn't this just the age old issue that Delphi's RTL unmasks floating point hardware exceptions, but most other tools (including the MS tools) mask them. Damn, even floating points have to wear masks right now. 3 Share this post Link to post