关于delphi软件运行出现Invalid floating point operation的错误的解决办法

关于delphi软件运行出现Invalid floating point operation的错误的解决办法  

 

 

关于delphi软件运行出现Invalid floating point operation的错误的解决办法
软件如果有webbrowser载入网页的时候经常会出现这个错误。这个错误是webbrowser3个Bug之一。
具体行程的原因大概我也不知道。基本是如果XP系统编译的,放到vista或者V7就容易出现这个错误。具体解决的办法也是很简单的。
查看官方的解决办法如下。
When running floating point code, such as that found in Direct 3D, you will often get a series of floating point exceptions. Microsoft supporesses these exceptions by default, but we raise them. It is easy to turn this option off in both C++Builder and Delphi.

Here is how to turn them off in C++Builder:

#include float.h

__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
  _control87(MCW_EM, MCW_EM);
}

Here is how to turn them off in Delphi:

  const
  MCW_EM = DWord($133f);
  begin
  Set8087CW(MCW_EM);
  end;

这是官方解决方案,大体的意思就是加上两句代码。具体家在哪里我说明一下。
  const
    MCW_EM = DWord($133f); 这一句是定义的常量,当然是写在定义常量的地方。
    Set8087CW(MCW_EM); 这一句就写在窗体创建的部分就可以了
就这么简单

转载于:https://www.cnblogs.com/honeynm/p/4112449.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值