那位好心的大侠帮我看看呀!
Dll 中的
function ShowMyForms(App:THandle;MyParent:TWinControl):integer;stdcall;
var
Form1:TForm1;
begin
Result:=1;
Application.Handle :=App;
Try
Form1:=TForm1.Create(MyParent);
// Form1.ScrollBox1.Parent :=MyParent;
// Form1.Show
Form1.Parent :=MyParent;
Form1.Align :=alClient;
Form1.Visible :=True;
ShowMessage('hello');
except
Result:=-1;
end;
end;
测试文件中的
procedure TForm100.Button1Click(Sender: TObject);
begin
ErrorCode:=ShowMyForms(Application.Handle,Panel1);
ShowMessage(InttoStr(ErrorCode));
end;