X
xuzhic2001
Unregistered / Unconfirmed
GUEST, unregistred user!
在网上找到一个用dll创建子窗体的例子.可是有个地方看不懂
unit MainUnit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ToolWin, ComCtrls, Menus;
type
TMainForm = class(TForm)
MainMenu1: TMainMenu;
Start: TMenuItem;
procedure StartClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
T_ProvaChild = procedure (ParentApplication: TApplication; ParentForm: TForm); stdcall;///就是这句话,不明白这个写法是什么意思?
var
MainForm: TMainForm;
implementation
{$R *.DFM}
procedure TMainForm.StartClick(Sender: TObject);
var
DllHandle: THandle;
ProcAddr: FarProc;
ProvaChild: T_ProvaChild;
begin
DllHandle := LoadLibrary('ProjectDll');
ProcAddr := GetProcAddress(DllHandle, 'ProvaChild');
if ProcAddr <> nil then
begin
ProvaChild := ProcAddr;
ProvaChild(Application,Self);
end;
end;
end.
unit MainUnit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ToolWin, ComCtrls, Menus;
type
TMainForm = class(TForm)
MainMenu1: TMainMenu;
Start: TMenuItem;
procedure StartClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
T_ProvaChild = procedure (ParentApplication: TApplication; ParentForm: TForm); stdcall;///就是这句话,不明白这个写法是什么意思?
var
MainForm: TMainForm;
implementation
{$R *.DFM}
procedure TMainForm.StartClick(Sender: TObject);
var
DllHandle: THandle;
ProcAddr: FarProc;
ProvaChild: T_ProvaChild;
begin
DllHandle := LoadLibrary('ProjectDll');
ProcAddr := GetProcAddress(DllHandle, 'ProvaChild');
if ProcAddr <> nil then
begin
ProvaChild := ProcAddr;
ProvaChild(Application,Self);
end;
end;
end.