高分求救 vb引用delqhi中的dll时 遇到的问题
sakas 2005-09-16 12:05:07
如下 :
Function SetOnFileArrive(Const p_Port :Integer;
Const p_OnFileArrive:TOnFileArrive):Boolean; stdcall; external 'JustPipe.Dll';
以上是delqhi中的函数
TOnFileArrive =Procedure(Const p_FileName:PChar);
以上是delqhi中的需要回调的函数
我在vb中是这样做的
Declare Function SetOnFileArriveOfObj Lib "JustPipe" (ByVal port As Integer, ByVal b As Long) As Boolean
Public Sub Hook()
a = SetOnFileArriveOfObj(2000, AddressOf gcb)
If a Then
MsgBox "ok"
End If
' lpPrevWndProc = SetWindowLong(gHW, GWL_WNDPROC, AddressOf gcb)
End Sub
回调函数为
Public Sub gcb(ByRef fillname() As Byte)
MsgBox fillname
End Sub
现在的问题是 回调已经成功 并弹出ok对话框 但接着 程序运行终止刮掉
我估计是参数传递的问题 有什么解决发子