阿
阿群
Unregistered / Unconfirmed
GUEST, unregistred user!
DLL代码如下:
library DateUDFLib;
{ 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
SysUtils,
Classes,
DateUtils;
Function F_MONTHSBETWEEN(FDATE,EDATE:TDATETIME):Integer;stdcall;
begin
result:=MonthsBetween(FDATE,EDATE);
end;
Function F_DAYSBETWEEN(FDATE,EDATE:TDATETIME):Integer;stdcall;
begin
result:=DaysBetween(FDATE,EDATE);
end;
Exports
F_MONTHSBETWEEN,
F_DAYSBETWEEN;
end.
INTERBASE 6.0中引用此DLL代码如下:
DECLARE EXTERNAL FUNCTION MONTHSBETWEEN
TIMESTAMP,
TIMESTAMP
RETURNS SMALLINT BY VALUE
ENTRY_POINT 'F_MONTHSBETWEEN' MODULE_NAME 'DateUDFLib';
出现的问题是:
用DELPHI编写的调用此DLL的程序就可以得出正确的结果,在INTERBASE中调用结果全部返回0,请各位高手看看哪里出了问题,应该怎么做呢?
library DateUDFLib;
{ 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
SysUtils,
Classes,
DateUtils;
Function F_MONTHSBETWEEN(FDATE,EDATE:TDATETIME):Integer;stdcall;
begin
result:=MonthsBetween(FDATE,EDATE);
end;
Function F_DAYSBETWEEN(FDATE,EDATE:TDATETIME):Integer;stdcall;
begin
result:=DaysBetween(FDATE,EDATE);
end;
Exports
F_MONTHSBETWEEN,
F_DAYSBETWEEN;
end.
INTERBASE 6.0中引用此DLL代码如下:
DECLARE EXTERNAL FUNCTION MONTHSBETWEEN
TIMESTAMP,
TIMESTAMP
RETURNS SMALLINT BY VALUE
ENTRY_POINT 'F_MONTHSBETWEEN' MODULE_NAME 'DateUDFLib';
出现的问题是:
用DELPHI编写的调用此DLL的程序就可以得出正确的结果,在INTERBASE中调用结果全部返回0,请各位高手看看哪里出了问题,应该怎么做呢?