1
12345yy
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是我的代码,请各位大虾指点
library FormDll;
uses
SysUtils,
Classes,
UmyForm in 'UmyForm.pas' {frmdll};
exports
showformdll;
{$R *.RES}
begin
end.
********************************************************
unit UmyForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
Tfrmdll = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmdll: Tfrmdll;
procedure showformdll(AppHandle: THandle);Stdcall;
implementation
{$R *.DFM}
procedure showformdll(AppHandle: THandle);
begin
Application.Handle := AppHandle;
With Tfrmdll.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;
end.
*******************************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure showformdll; stdcall external 'FormDll.dll';
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
showformdll;
end;
end.
library FormDll;
uses
SysUtils,
Classes,
UmyForm in 'UmyForm.pas' {frmdll};
exports
showformdll;
{$R *.RES}
begin
end.
********************************************************
unit UmyForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
Tfrmdll = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmdll: Tfrmdll;
procedure showformdll(AppHandle: THandle);Stdcall;
implementation
{$R *.DFM}
procedure showformdll(AppHandle: THandle);
begin
Application.Handle := AppHandle;
With Tfrmdll.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;
end.
*******************************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
procedure showformdll; stdcall external 'FormDll.dll';
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
showformdll;
end;
end.