problem solved and here is the code:
//This is the DLL
library Project1dll;
uses
SysUtils,
Windows,
Classes,
DllForm in 'DllForm.pas' {frmDllForm}; // this is the other form
procedure Create_Form(ph: HWND);
begin
frmDllForm:= TfrmDllForm.CreateParented(Ph);
frmDllForm.Show;
end;
Exports
Create_Form;
begin
end.
//---------------------END--------------------------------------
//This is the project
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
ScrollBox: TScrollBox;
procedure Button1Click(Sender: TObject);
private
end;
procedure Create_Form(ph: HWND) ; external 'Project1dll.dll' name 'Create_Form';
var
Form1: TForm1;
implementation
{$R *.DFM}
function ScrollBoxDll(ph: HWND): Pointer; stdcall;
begin
Create_Form(ph);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ScrollBoxDll(ScrollBox.Handle);
end;
end.