在DLL中语句是如下声明的
extern "C" long _stdcall MakeGstCard(short room,short bed,tm *maketime,tm *validitytime,short *Rom)在VB中语句是如下声明的
Private Type TM
tm_sec As Long
tm_min As Long
tm_hour As Long
tm_mday As Long
tm_mon As Long
tm_year As Long
End TypePrivate Declare Function MakeGstCard Lib "C:\From D\Icow\icowib_test\icowib.dll" (ByVal room As Integer, ByVal bed As Integer, maketime As TM, validitytime As TM, ByRef Rom As Long) As Double
....
With mkt
.tm_year = 2001
.tm_mon = 5
.tm_mday = 18
.tm_hour = 0
.tm_min = 0
.tm_sec = 0
End With
With vdt
.tm_year = 2001
.tm_mon = 5
.tm_mday = 19
.tm_hour = 0
.tm_min = 0
.tm_sec = 0
End Withk = MakeGstCard(room, bed, mkt, vdt, a(0)).......
extern "C" long _stdcall MakeGstCard(short room,short bed,tm *maketime,tm *validitytime,short *Rom)在VB中语句是如下声明的
Private Type TM
tm_sec As Long
tm_min As Long
tm_hour As Long
tm_mday As Long
tm_mon As Long
tm_year As Long
End TypePrivate Declare Function MakeGstCard Lib "C:\From D\Icow\icowib_test\icowib.dll" (ByVal room As Integer, ByVal bed As Integer, maketime As TM, validitytime As TM, ByRef Rom As Long) As Double
....
With mkt
.tm_year = 2001
.tm_mon = 5
.tm_mday = 18
.tm_hour = 0
.tm_min = 0
.tm_sec = 0
End With
With vdt
.tm_year = 2001
.tm_mon = 5
.tm_mday = 19
.tm_hour = 0
.tm_min = 0
.tm_sec = 0
End Withk = MakeGstCard(room, bed, mkt, vdt, a(0)).......
struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of the month - [1,31] */
int tm_mon; /* months since January - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag */
};声明成这样看看
Private Type TM
tm_sec As Integer
tm_min As Integer
tm_hour As Integer
tm_mday As Integer
tm_mon As Integer
tm_year As Integer
tm_wday As Integer
tm_yday As Integer
tm_isdst As Integer
End Type
Private Declare Function MakeGstCard Lib "C:\From D\Icow\icowib_test\icowib.dll" (ByVal room As Integer, ByVal bed As Integer, maketime As TM, validitytime As TM, ByRef Rom As Long) As long就没事啦