G
gao_ad
Unregistered / Unconfirmed
GUEST, unregistred user!
我编写里一个动态库,在delphi的程序中调用没有问题,但是在pb中调用就出错。请各位打侠指教。
library count_table6;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
SysUtils,
Dialogs,
Forms,
Classes,
ib_DataModule in 'ib_DataModule.pas' {DataModule1: TDataModule};
//******************************************************//
// 函数名称:list_table6
//参数:project_name,start_date:string 工程名称 ,统计起始时间
//返回值:integer 0 有结果 ,1 没有结果
//******************************************************//
function list_table6(project_name,start_date:string):integer;stdcall;
begin
//生成数据模块
showmessage('create DataModule');
DataModule1 := TDataModule1.Create(nil);
showmessage('retrieve data');
//返回结果
Result := DataModule1.list_table6(project_name,start_date);
showmessage('retrieve end');
DataModule1.Destroy;
showmessage('destory DataModule');
end;
exports
list_table6;
{$R *.res}
begin
end.
library count_table6;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
Windows,
SysUtils,
Dialogs,
Forms,
Classes,
ib_DataModule in 'ib_DataModule.pas' {DataModule1: TDataModule};
//******************************************************//
// 函数名称:list_table6
//参数:project_name,start_date:string 工程名称 ,统计起始时间
//返回值:integer 0 有结果 ,1 没有结果
//******************************************************//
function list_table6(project_name,start_date:string):integer;stdcall;
begin
//生成数据模块
showmessage('create DataModule');
DataModule1 := TDataModule1.Create(nil);
showmessage('retrieve data');
//返回结果
Result := DataModule1.list_table6(project_name,start_date);
showmessage('retrieve end');
DataModule1.Destroy;
showmessage('destory DataModule');
end;
exports
list_table6;
{$R *.res}
begin
end.