’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())

解决方案 »

  1.   

    还有一个问题,
    在CB中自定义一个消息,能否传给VB?(CB做的是DLL)
      

  2.   

    定义成ANY试试!Public Declare Function ReadAllInfo_VB Lib "patrol_t.dll" (ByVal port As Long, ByRef char1 as any, ByRef char2 as any, ByRef temperature as any) As Long
      

  3.   

    可是,我在调用的时个(调试状态),连VB也一起关了!!!(刷的一下全部消失了)
    注:win2k+vb6+sp4
      

  4.   

    Dim bytReadData1(32767) As Byte
    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)