델파이에서 함수 포인터 정의하여 사용하기
절름발이 프로그래머/Delphi / 2009. 10. 27. 16:21
http://www.programmersheaven.com/mb/delphikylix/245467/245467/pointer-to-function/
를 참고하였습니다.
---------------------------------------------------------------------------
type
TFuncPtr = function(arg1: Integer; arg2: PChar): Integer; stdcall;
TProcThread = class(TThread)
...
protected
procedure SyncProc(Data: Pointer);
...
end;
function MyFunc(arg1: Integer; arg2: PChar): Integer; stdcall;
procedure SetSyncProc(argFunc: TFuncPtr); external;
constructor TProcThread.Create;
begin
...
SetSyncProc(MyFunc);
...
end;