首页 > 编程 > C++ > 正文

如何将C/C++程序转译成Delphi(九)

2019-11-18 18:50:15
字体:
来源:转载
供稿:网友

Case Integer of starts the variant part of the record. Each variant is identified by an ordinal value. This value has no meaning when the type is being used, but is required for declaration.

Please note the difference between a variant (case-) record and a record without case-declaration.

The following translation is wrong:

type  PPRocessHeapEntry = ^TProcessHeapEntry;  TProcessHeapEntry = Record    lpData: Pointer;    cbData: DWord;    cbOverhead: Byte;    iRegionIndex: Byte;    wFlags: Word;    Block: Record       hMem: Thandle       Reserved : Array [0..2] of DWord;    end;    Region: Record      dwCommittedSize: DWord;      dwUnCommittedSize: DWord;      lpFirstBlock: Pointer;      lpLastBlock: Pointer    end);  end;

This wrong translation would cause Block and Region to be consecutive in memory, and not overlaid, as follows:

LpData, cbData, cbOverhead, iRegionIndex, wFlags HMem, dwReserved DwCommittedSize, dwUnCommittedSize, lpFirstBlock, lplastBlock


Back to contents


上一篇:如何将C/C++程序转译成Delphi(十)

下一篇:如何将C/C++程序转译成Delphi(八)

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
学习交流
热门图片

新闻热点

疑难解答

图片精选

网友关注