’VC 写的DLL
'函数原型
' int ReadAllInfo_VB(BYTE port,char info0[32767],char info1[32767],char,temperature[32767])这么写声明行否?
Public Declare Function ReadAllInfo_VB Lib "patrol_t.dll" (ByVal port As Long, ByRef char1() As Byte, ByRef char2() As Byte, ByRef temperature() As Byte) As Long
这么调用行否?
Dim bytReadData1(32767) As Byte
Dim bytReadData2(32767) As Byte
Dim temperature(32767) As Byte
Dim lngDataRec As Long
lngDataRec = ReadAllInfo_VB(lngSysPort, bytReadData1, bytReadData2(), bytReadData2())
'函数原型
' int ReadAllInfo_VB(BYTE port,char info0[32767],char info1[32767],char,temperature[32767])这么写声明行否?
Public Declare Function ReadAllInfo_VB Lib "patrol_t.dll" (ByVal port As Long, ByRef char1() As Byte, ByRef char2() As Byte, ByRef temperature() As Byte) As Long
这么调用行否?
Dim bytReadData1(32767) As Byte
Dim bytReadData2(32767) As Byte
Dim temperature(32767) As Byte
Dim lngDataRec As Long
lngDataRec = ReadAllInfo_VB(lngSysPort, bytReadData1, bytReadData2(), bytReadData2())
在CB中自定义一个消息,能否传给VB?(CB做的是DLL)
注:win2k+vb6+sp4
to: flxa()
按你说的定义,我这样调,也消失!!!!
Dim bytReadData2(32767) As Byte
Dim temperature(32767) As Byte
Dim lngDataRec As Long
Dim addReadD1 As Long
Dim addReadD2 As Long
Dim addTemp As Long
addReadD1 = StrPtr(bytReadData1())
addReadD2 = StrPtr(bytReadData2())
addTemp = StrPtr(bytReadData2())
lngDataRec = ReadAllInfo_VB(lngSysPort, addReadD1, addReadD2, addTemp)