Delphi 类与对象内存结构浅析(附件2)
*类的公开属性(代码)
示例:访问类的published属性
说明:vmtFieldTable(Published Field表)指向Published Field表有序排列,只存储当前类的PublishedField表,得到父类的Published Field表需要往上遍历。
注意:只有类型是类或接口的数据成员才可定义为published的访问级别
代码:
type
TMyObject = class(TObject)
private
FField1: Integer;
FField2: string;
FField3: array[0..2] of Integer;
published
Button1: TButton;
Memo1: TMemo;
Label1: TLabel;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
AObject: TMyObject;
//---
procedure _ShowDMTInfo(ALines: TStrings; AClass: TClass);
var
AClassAddress,AFTAddress: Integer;
AFieldCount,AFieldIndex,AFieldOffset,AFieldNameLen: Integer;
APos,i: Integer;
AFieldName: ShortString;
begin
AClassAddress := Integer(AClass);
with ALines do
begin
Add(Format('类名: %s ', [AClass.ClassName]));
//---
AFTAddress := Integer(PPointer(AClassAddress + vmtFieldTable)^);
if AFTAddress = 0 then
&n
相关文档:
一、引子:
现在的Windows应用程序几乎都使用图标、图片、光标、声音等,我们称它们为资源(Resource)。最简单的使用资源的办法是把这些资源的源文件打入软件包,以方便程序需要的时候调用。资源是程序的一部分,程序要正常运行就离不了资源文件。但是它是不可执行代码。
&n ......
一、Dll建立
(一)DLL项目的建立
library mydll;
uses
base in 'base.pas';
exports
Triple name 'Tr';
{$R *.res}
begin
end.
(二)函数单元
unit base;
interface
uses windows;
function Triple(N:integer):integer;stdcall;
  ......
Delphi 能不能从Ring 3进入Ring 0?
楼主skyworld_xm(skyworld)2004-11-19 09:58:55 在 Delphi / Windows SDK/API 提问
Delphi 能不能从Ring 3进入Ring 0?
有例子吗?
多谢. 问题点数:100、回复次数:20Top
1 楼jinjazz(近身剪)回复于 2004-11-19 10:13:27 得 ......