I am trying to show a FMX form in Inno Setup using an dll. i created a DLL and added the form to the DLL.dll. here is the code from the dll:
library DLL;
uses
System.SysUtils,
System.Classes,
Winapi.Windows, Winapi.Messages, System.Variants,
DLLForm in 'DLLForm.pas' {Form2};
{$R *.res}
procedure ShowForm; stdcall;
begin
Form2:=TForm2.Create(nil);
Form2.ShowModal;
Form2.Free; //Added this line.
end;
Exports ShowForm;
end.
and here it is the code for inno:
[Setup]
AppName=Windows
AppPublisher=Stack
AppVersion=1.0.0.0
DefaultDirName={pf}\FMXForm
[Files]
Source: Include\DLL.dll; DestDir: {tmp} Flags: dontcopy;
[code]
procedure Show;
external 'ShowForm@Files:DLL.dll stdcall delayload';
procedure InitializeWizard();
begin
Show;
end;
Setup Compiles but did not showing the form and exits without showing any errors.
It is working fine with cmd,vcl apps but with inno it is not. I used following code to show the form from dll in cmd,vcl apps :
procedure ShowForm; stdcall; external 'DLL.dll';
...
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Free;
ShowForm;
end;
cmd
app and withvcl
app created in Delphi but withinno
it's not working. I Tried to create anvcl
form with same method above but it is not working. – bearinno
procedure calling code because it is working fine withcmd
,VCL
apps. – bear