How call and execute a method present in a .dll file and show your (s) Form (s)? : <p>I had that imported a Form already made for a .dll file, and now want call this Form from of my .exe software and open he normally on .dll file.</p>

<p>This is all that have until now, but nothing works :-(</p>

<p><strong><em>Dll file with a Form inside</em></strong></p>

<pre><code>library test;


uses
  System.SysUtils,
  Winapi.Windows,
  UMyForm, // Reference to my Form (traditional VCL Form)
  System.Classes,
  StrUtils;

{$R *.res}

var
HProcess: THandle;
Hid: Cardinal;
b: Boolean = False;

procedure Call;
begin
  MyForm := TMyForm.Create(nil);
  MyForm.ShowModal;
 end;
end;

begin

 HProcess:= OpenProcess(PROCESS_ALL_ACCESS,False,GetCurrentProcessId);
 CreateRemoteThread(HProcess,nil,0,@call,@call,0,Hid);

end.
</code></pre>

<p><strong><em>My software that call and open the Form of Dll file</em></strong></p>

<pre><code>unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    btn1: TButton;
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);
begin
 LoadLibraryA(PAnsiChar('test.dll'));
end;

end.
</code></pre>
