求助:VB转VFP的DLL声明及调用
在调试一个短信猫程序,源程序和DLL文件是的,现在连接和发送都调试好了,接收短信却不行,推测问题应该是出在VB中的ByRef上,请高手指点赐教。'Sms_Receive函数说明如下:
'功能描述:接收指定类型的短信
'Sms_Type:短信类型(0:未读短信;1:已读短信;2:待发短信;3:已发短信;4:全部短信)
'Sms_Text:返回指定类型的短信内容字符串(短信内容字符串说明:短信与短信之前用"|"符号作为分隔符,每条短信中间的各字段用"#"符号作为分隔符)
*VB源码**********************
声明
Option Strict Off
Option Explicit On
Public Declare Function Sms_Receive Lib "sms.dll" (ByVal Sms_Type As String, ByRef Sms_Text As String) As Integer
调用
Dim ReceiveSmsStr As String
If Sms_Receive("4", ReceiveSmsStr) Then
ReceiveSms_Text.Text = ReceiveSmsStr
End If
***我写的VFP*********
声明
DECLARE Integer Sms_Receive IN "sms.dll" String Sms_Type,String @Sms_Text
调用
LOCAL ReceiveSmsStr As String
ReceiveSmsStr=''
Sms_Receive("4",@ReceiveSmsStr)
IF EMPTY(ReceiveSmsStr)
thisform.text1.Value='no'
ELSE
thisform.text1.Value=ReceiveSmsStr
ENDIF
问题:
1.始终得不到短信内容
2.在1-4轮换时,有时出现“DLL调用异常”,有时不出现