本文整理自网络,侵删。
直接nevigate打开https://www.paypal.com
出现invalid floating point operation的错误,同时页面中的连接就无法再在tWEBbrowser中访问了.
有办法解决这个错误么
unit UnIT1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw;
type
TForm1 = class(TForm)
WebBrowser1: TWEBBrowser;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
try
WEBBrowser1.Navigate('https://www.paypal.com');
except
end;
end;
end.
大概的情况是,在使用一些浮点操作时,微软默认设计会抛出一系列的异常.这些异常按理说不应该阻止程序运行.但不知道为什么,
Delphi默认是截获后又把异常抛了出来,被系统截获就会影响程序运行了
borland给的解决方法是,加一句Set8087CW(Longword($133f));来关闭这个机制. 你可以加在form的oncreate事件里
相关阅读 >>
Delphi 数据类型cardinal 怎么转换成 string?
Delphi实现win10下Delphi 10.3.1 inline hook 调试器法获取寄存器并修改
Delphi webbrowser 无法调用当前浏览器的版本
更多相关阅读请进入《Delphi》频道 >>