1. Create form => fromtest. Pas {fromtest. DFM}
VaR
Frmdll: tfrmdll;
Procedure synapp (APP: thandle); stdcall;
Procedure showform; stdcall;
Implementation
Uses math, F2;
{$ R * . DFM}
Procedure synapp (APP: thandle); stdcall;
Begin
Application. Handle: = APP;
End ;
Procedure showform; stdcall;
Begin
Try
Frmdll: = Tfrmdll. Create (application );
Finally
Freeandnil (frmdll );
End ;
End ;
2. Create DLL wizard => formdll. DPRLibrary formdll;
Uses
Sysutils,
Classes,
Forms,
Formtest in'Formtest. pa' {frmdll },
{$ R*. Res}
Exports
Synapp, showform;
Begin
End.
Compile formdll. DPR to generate formdll. dll
3. InProgramMedium
VaR
Form1: tform1;
Procedure synapp (APP: thandle); stdcall; external ' Formdll. dll ';
Procedure showform; stdcall; external ' Formdll. dll ';
Implementation
{$ R * . DFM}
Procedure tform1.button1click (Sender: tobject );
Begin
Synapp (application. Handle );
Showform;
End ;