vb调用DELPHI写的动态库问题
function MXReadFingerFromSensor(FingerBufchar):Boolean; stdcall; external 'JLZD02.DLL'\\DELPHI中的函数
VB中的代码:
Public Declare Function drjw Lib "JLZD02.DLL" Alias "MXReadFingerFromSensor" (ByVal Pchar As String) As Boolean
Private Sub Command5_Click()
dim s as string
s = String(255, vbNullChar)
If (drjw(s) = False) Then
MsgBox "读入失败!"
Else
MsgBox "读入成功!"
End If
End Sub程序运行后,提示内存读取错误,然后自动关闭VB,问题出在哪啊,高手帮帮忙吧,弄了一天也没解决啊!!!!
function MXReadFingerFromSensor(FingerBufchar):Boolean; stdcall; external 'JLZD02.DLL'\\DELPHI中的函数
VB中的代码:
Public Declare Function drjw Lib "JLZD02.DLL" Alias "MXReadFingerFromSensor" (ByVal Pchar As String) As Boolean
Private Sub Command5_Click()
dim s as string
s = String(255, vbNullChar)
If (drjw(s) = False) Then
MsgBox "读入失败!"
Else
MsgBox "读入成功!"
End If
End Sub程序运行后,提示内存读取错误,然后自动关闭VB,问题出在哪啊,高手帮帮忙吧,弄了一天也没解决啊!!!!
If (drjw(strptr(s)) = False) Then
delphi中是这样定义的:
var
FingerBuf:Array[0..303,0..255] of char;
函数是这样的:function MXReadFingerFromSensor(FingerBuf:Pchar):Boolean; stdcall; external 'JLZD02.DLL'哪位帮忙解决一下吧!急死我了!!!!!
Private Sub Command5_Click()
dim chars(303,255) as byte
If (drjw(chars(0,0) = False) Then
MsgBox "读入失败!"
Else
MsgBox "读入成功!"
End If
End Sub