|
|
|
Navigation
0 users online | 0 Guests and 0 Registered
|
Delphi » VCLID #1008
Ein Formular (TForm) aus einer DLL aufrufen/anzeigenDer Sourcecode der DLL muss so aussehen : library FormDialog;
uses
SysUtils,
Classes,
Windows,
Forms,
FormUnit in 'FormUnit.pas' {UserForm};
{$R *.res}
procedure UserForm(appHandle: THandle); stdcall;
begin
if appHandle = 0 then apphandle := GetActiveWindow;
Application.Handle := appHandle;
try
with TUserLoginMain.Create(Application) Do // hier muss natürlich der Klassen-Bezeichner der Form stehen
// TUserLoginMain ist nur ein Beispiel
try
ShowModal
finally
Free;
end
except
On E: Exception Do Application.HandleException(E);
end;
Application.Handle := 0;
end;
exports
UserForm;
begin
end.
Der Import der Procedure im Hauptprogramm erfolgt dann folgendermaßen : procedure UserForm(appHandle:THandle); stdcall; external '<dll-name>'; Der eigentliche Aufruf des Fensters (Formulars) erfolgt so : procedure TForm1.Buuton1Click(Sender:TObject); begin UserForm(Application.Handle); end;
Tags: - Related entries: Last update: 2009-10-27 23:07 You can comment this FAQ |
Most popular FAQs
|