LongWord($133f)这句是什么意思

fieldisme 2015-07-11 09:02:45
LongWord($133f)这句是什么意思,如何转换成bcb的语法?
在用bcb编写浏览器时出现Invalid floating point operation错误,在网上查到要调用Set8087CW(LongWord($133f));,不知道在bcb中怎么表达
...全文
480 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
// Default value (with exceptions) is 0x1372.这个注释是错的,默认值是0x1332。 Set8087CW是Delphi RTL函数,C++中最好还是用_control87或者_controlfp。
缘中人 2015-07-13
  • 打赏
  • 举报
回复
找到了官方资料 http://docwiki.embarcadero.com/CodeExamples/XE8/en/Set8087CW_%28C%2B%2B%29
Word Saved8087CW;
 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Edit3->Text = FloatToStr(StrToFloat(Edit1->Text) / StrToFloat(Edit2->Text));
}
 
void __fastcall TForm1::RadioGroup1Click(TObject *Sender)
{
  if (RadioGroup1->Items->Strings[RadioGroup1->ItemIndex] == "FPU Exceptions")
	System::Set8087CW(Saved8087CW);
  if (RadioGroup1->Items->Strings[RadioGroup1->ItemIndex] == "No FPU Exceptions")
	System::Set8087CW(0x133f); // Disable all fpu exceptions.
}
 
__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
  RadioGroup1->Items->Add("No FPU Exceptions");
  RadioGroup1->Items->Add("FPU Exceptions");
  RadioGroup1->ItemIndex = 2;
  Saved8087CW = Default8087CW;  // Save this, because Set8087CW changes it.
}
 
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
  System::Set8087CW(Saved8087CW); // Default value (with exceptions) is 0x1372.
}
  • 打赏
  • 举报
回复
这个应该用_control87或者_controlfp #include <float.h> _control87(0x133f, 0xffff); 至于LongWord($133f)这是没有什么意义的,LongWord($133f)=$0000133f,32位无符号整数,仅此而已。
缘中人 2015-07-12
  • 打赏
  • 举报
回复
	
LongWord(0x133f);
或者

LongWord lw;
	lw = LongWord(0x133f);
Delphi基于Ring0技术读写Windows系统下的硬盘物理扇区,磁盘读写操作一例,包括了VxD和仿CIH两种方法,VxD方法中还包括了所调用控件的VC 源代码,并且包括了一个测试的例子,运行效果如演示截图所示。相关的源代码分享如下:   IOR_next:longword;{ 为BCB的(MBZ for IORF_VERSION_002) 的客户链接 }   IOR_func:word;{子功能号}   IOR_status:word;{请求的状态}   IOR_flags:longword;{请求控制标志}   IOR_callback:procedure;{如果IORF_SYNC_COMMAND未设置,则为回调函数地址}   IOR_start_addr:array[0..1]of longword;{相对开始地址}   IOR_xfer_count:longword;{处理的扇区数}   IOR_buffer_ptr:longword;{客户缓冲区指针}   IOR_private_client:longword;{ BlockDev/IOS客户保留}   IOR_private_IOS:longword;{IOS保留空间}   IOR_private_port:longword;{端口驱动的私有区域}   _ureq:Turequestor_usage;   IOR_req_req_handle:longword;{请求句柄}   IOR_req_vol_handle:longword;{媒体句柄,指向VRP结构}   IOR_sgd_lin_phys:longword;{指向第一个物理SGD }   IOR_num_sgds:byte;{物理SGD的数目}   IOR_vol_designtr:byte;{视子功能号的不同,可能是以下两种情况:(1)A盘为0,B盘为1,C盘为2……(2)软盘是0-7F,硬盘是80-FF}   IOR_ios_private_1:word;{由IOS保留强制对齐}   IOR_reserved_2:array[0..1]of longword; {保留,内部使用}

13,871

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧