Thema: Delphi Forms in DLL erzeugen

Einzelnen Beitrag anzeigen

Benutzerbild von LoRd-MuldeR
LoRd-MuldeR

Registriert seit: 9. Okt 2005
Ort: Somewhere over the Slaughterhouse
132 Beiträge
 
Delphi 7 Professional
 
#1

Forms in DLL erzeugen

  Alt 1. Feb 2006, 20:08
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
  Mit Zitat antworten Zitat