Lazarus / delphiでメンバー関数のポインタを取得する方法はありますか? 私はコンパイルできないこのコードを持っています....
エラーはDelphiにあります:
variable required
Lazarusにあります:
Error: Incompatible types: got "<procedure variable type of function(Byte):LongInt of object;StdCall>" expected "Pointer"
コード:
TClassA = class
public
function ImportantFunc(AParameter: byte): integer; stdcall;
end;
TClassB = class
public
ObjectA: TClassA;
ImportantPtr: pointer;
procedure WorkerFunc;
end;
function TClassA.ImportantFunc(AParameter: byte): integer; stdcall;
begin
// some important stuff
end;
procedure TClassB.WorkerFunc;
begin
ImportantPtr := @ObjectA.ImportantFunc; // <-- ERROR HERE
end;
ありがとう!