C
cqxiangyi
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
varVMT1:TClass;
varVMT2:TClass;
begin
varVMT1 := form1.ClassParent;
varVMT2 := TClass(pointer(integer(form1.ClassType)+vmtParent)^);
//根据delphi的对象模型varVMT1和varVMT2值相等。但.....
if integer(varVMT1)=integer(varVMT2) then
ShowMessage('ok')
else
ShowMessage('noequal');
end;
难到其对象模型我搞错了?如何写varVMT1和varVMT2才相等??
var
varVMT1:TClass;
varVMT2:TClass;
begin
varVMT1 := form1.ClassParent;
varVMT2 := TClass(pointer(integer(form1.ClassType)+vmtParent)^);
//根据delphi的对象模型varVMT1和varVMT2值相等。但.....
if integer(varVMT1)=integer(varVMT2) then
ShowMessage('ok')
else
ShowMessage('noequal');
end;
难到其对象模型我搞错了?如何写varVMT1和varVMT2才相等??