L
lixianxiang
Unregistered / Unconfirmed
GUEST, unregistred user!
我直接引用单元文件,调用Pvt_ExportDBGrid执行正常,而采用静态调用DLL,就会出错:Ole error 800A03EC什么原因?麻烦高手指教下,谢谢了代码如下:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids;type TForm1 = class(TForm) ADOConnection1: TADOConnection; DBGrid1: TDBGrid; ADOTable1: TADOTable; DataSource1: TDataSource; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation// uses Functions;procedure Pvt_ExportDBGrid(ADBGrid: TDBGrid; AStartRowNo: Integer); stdcall; external 'MyDLL.dll';procedure Pvt_ShowMessage; stdcall; external 'MyDLL.dll';procedure Pvt_EndProcess(AFileName: string); stdcall; external 'MyDLL.dll';{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin Pvt_ShowMessage; try Pvt_ExportDBGrid(DBGrid1, 2); except Pvt_EndProcess('EXCEL.EXE');// raise; end; end;end.MyDLL如下:library MyDLL;uses SysUtils, Classes, Functions in 'Functions.pas';exports Pvt_ExportDBGrid, Pvt_EndProcess, Pvt_CheckNUMOnKeyPress, Pvt_CheckNUMOnExit, Pvt_ColNumToChar, Pvt_ShowMessage;{$R *.res}beginend.