DLL:
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, Grids, DBGrids;
type
TfrmTryOne = class(TForm)
DataSource1: TDataSource;
DBGrid1: TDBGrid;
private
{ Private declarations }
public
{ Public declarations }
end;
procedure OperatorTable(DataSet: Pointer);stdcall;
implementation
{$R *.dfm}
procedure OperatorTable(DataSet: Pointer);stdcall;
begin
with TfrmTryOne.Create(nil) do
try
DataSource1.DataSet:=TDataSet(DataSet);
ShowModal;
finally
Free;
end;
end;
end.
程序:
implementation
procedure OperatorTable(DataSet: Pointer);stdcall;external 'e:/mydll/myfunc/funcs.dll';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
OperatorTable(Pointer(Table1));
end;