Z
zhang12345
Unregistered / Unconfirmed
GUEST, unregistred user!
type
TOnError = procedure(aErrorID: integer; aErrorMsg: shortstring) of object; stdcall;
procedure Test.TestOnError(aErrorID: integer; aErrorMsg: shortstring); stdcall;
begin
Showmessage(aErrorMsg);
end;
var
TmpOnError: TOnError;
TmpOnError1: TOnError;
pOnError: ^TOnError;
p: pointer;
begin
New(pOnerror);
TmpOnError := TestOnError;
TmpOnError(1, '2');
p := @TmpOnError;
pOnError^ := TOnError(p)^; //此处赋值错误, 请给出正确用法
// pOnError^ := TmpOnError;
TmpOnError1 := pOnError^;
TmpOnError1(11, '3');
Dispose(pOnError);
end;
TOnError = procedure(aErrorID: integer; aErrorMsg: shortstring) of object; stdcall;
procedure Test.TestOnError(aErrorID: integer; aErrorMsg: shortstring); stdcall;
begin
Showmessage(aErrorMsg);
end;
var
TmpOnError: TOnError;
TmpOnError1: TOnError;
pOnError: ^TOnError;
p: pointer;
begin
New(pOnerror);
TmpOnError := TestOnError;
TmpOnError(1, '2');
p := @TmpOnError;
pOnError^ := TOnError(p)^; //此处赋值错误, 请给出正确用法
// pOnError^ := TmpOnError;
TmpOnError1 := pOnError^;
TmpOnError1(11, '3');
Dispose(pOnError);
end;