關於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); 這一句就寫在窗體創建的部分就可以了
就這么簡單


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM