给你个例子:
procedure showdll(AppApplication: Tapplication
APPhandle: THandle
AppSessions:
TSession
AppPanel: Tpanel
LogParam: array of string)
stdcall;//参数你就往里面传
var OldHandle: Thandle;
i: integer;
begin
OldHandle := Application.Handle;
Application.Handle := Apphandle;//原来程序的HANDLE
Session := AppSessions;
setlength(VARLOGPARAM, 12);
fm_main := Tfm_main.Create(nil);//DLL窗体
with fm_main do
begin
try
for i := 0 to 11 do
begin
varlogparam := logparam;
end;
dm := Tdm.create(Application);
showmodal;
finally
Free;
Application.Handle := OldHandle;
end;
end;
end;