给出了C里面的函数定义
库名称为softpos.dll
int  CreditTrans( char *strin, char *strout )或
int  CreditTransABC( char *strin, char *strout )
strin为传入参数,请求;
strout为传出参数,回应。这个在VB里面应该怎么声明和调用

解决方案 »

  1.   

    Public Declare Function CreditTrans Lib "softpos.dll" (ByRef strin As Byte, ByRef strout As Byte) As LongDim strin(255) As Byte, strout(255) As Byte, Ret As Long
    ......Ret = CreditTrans(strin(0), strout(0))
      

  2.   

    int  CreditTransABC( char *strin, char *strout )
    ==>Public Declare Function CreditTrans Lib "softpos.dll" (ByVal strin As string, ByVal strout As string) As Long
    dim ret as long
    dim s1 as string,s2 as string
    s1=....
    ret=CreditTrans (s1,s2)
      

  3.   

    你好 看到你的回答 我最近也在接触VB 在调用dll时有些不解
    Public Declare Function Add Lib "F:\VB6\MyDll.dll" (ByVal a As Integer, ByVal b As Integer) As Integer
     
    Private Sub Command2_Click()Dim a1, a2, a3 As Integer
    a1 = 1
    a2 = 2
    a3 = Add(a1, a2)
    End Sub
    我的报错 constants, fixed-length strings,arrays, user-defined types and declare statements not allowed as public menbers of object modules
    不知这个怎么改 谢谢啦