INTERBASE中关于日期的UDF问题(500分送上)(100分)

  • 主题发起人 主题发起人 阿群
  • 开始时间 开始时间

阿群

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,请各位高手看看哪里出了问题,应该怎么做呢?
 
是不是IB不认得TDateTime?当初用IB就它这个DLL最麻烦!我真不明白:为什么IB不提供一些标准功能的函数(我记得它就提供了4个)?
 

Similar threads

I
回复
0
查看
648
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
616
import
I
后退
顶部