掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
コールバック関数からクラスメンバにアクセスするには? (ID:31618)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
失礼しました。 unit uTest; interface uses Windows, SysUtils, Classes, ExtCtrls , StdCtrls; Function TESTLIB(pfnCallback:pointer):Cardinal; stdcall; external 'TEST.Dll'; type TTest = class(TObject) private FTag : integer; protected procedure TestCallback(item:Integer); public constructor Create; destructor Destroy;override; function Start():boolean; property Tag : integer read FTag write FTag; published end; implementation var tst:TTest; procedure TTest.TestCallback(item:Integer); begin Tag:=item; end; procedure aTestCallback(item:Integer); begin tst.TestCallback(item); end; function TTest.Start():boolean; begin tst:=self; TESTLIB(addr(aTestCallback)); end; としてみたのですが、どうでしょうか?
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.