Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Forms in DLL erzeugen (https://www.delphipraxis.net/62250-forms-dll-erzeugen.html)

LoRd-MuldeR 1. Feb 2006 20:08


Forms in DLL erzeugen
 
Hi

Also, ich möchte eine DLL, genauer gesagt ein Plugin für NSIS, erstellen. Das ist soweit auch kein Problem, weil es im NSIS Quellcode eine Vorlage für ein Plugin für Delphi7 gibt. Leider hab ich es bisher nich gebacken bekommen meine Forms anzuzeigen. Welche Code muss ich dafür in der DLL benutzen?

Dieser Code will jedenfalls nich!
Runtime Error :(


Delphi-Quellcode:
library exdll;

uses
  nsis,
  windows,
  forms,
  Unit1 in 'Unit1.pas' {Form1};

procedure ex_dll(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer); cdecl;
var
  Form: TForm1;
begin
  // set up global variables
  Init(hwndParent, string_size, variables, stacktop);

  Form := TForm1.Create(nil);

  Form.BaseDir := GetUserVariable(INST_OUTDIR);
  Form.FileName := GetUserVariable(INST_0);

  //MessageBox(0, PAnsiChar(Form.BaseDir + #10 + Form.FileName),nil,MB_OK + MB_TOPMOST);

  Form.ShowModal;
  Form.Free;
end;

exports ex_dll name 'Play';

begin
end.

Weiß jemand Rat ???
Danke :-D

Luckie 1. Feb 2006 20:11

Re: Forms in DLL erzeugen
 
Guck dir mal das DLL Tutorial von Olli an: http://www.michael-puff.de/dirindex....orte/Assarbad/

LoRd-MuldeR 1. Feb 2006 20:57

Re: Forms in DLL erzeugen
 
Danke. Damit schein es zu funktionieren :-D

LoRd-MuldeR 1. Feb 2006 23:10

Re: Forms in DLL erzeugen
 
Jetzt hab ich noch folgendes Problem:

Wenn ich bei meiner DLL Form während eines "ShowModal" die "Close" Methode aufrufe, um das Hauptprogramm fortzusetzten, passiert irgendwie nix. Erst wenn man die Maus bewegt oder eine Taste drückt, geht das Fenster zu und das Hauptprogramm läuft weiter...

Jemand ne Idee woran das liegen könnte?


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:16 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz