ByRef参数类型不符,弄了半天也没搞明白怎么回事,特此请教。
从网上找了段ADSL拨号的程序,执行学习学习,但点拨号按钮时候提示错误。
编译错误
ByRef参数类型不符
错误提示如下:
ConnectStatus = AddConnection(sNameStr, "", "", sUserName, sPasswd, "")
在该过程里定义如下:
Dim sNameStr, sUserName, sPasswd As String
调用的函数头如下:
Public Function AddConnection(strNewEntryName As String, strNewPhoneNumber As String, strNewCallbackNumber As String, strNewUsername As String, strNewPassword As String, strNewDomain As String) As Long
定义的都是String类型啊,哪里出错了,高手指点下。谢谢。
[解决办法]
定义要这样写,Dim sNameStr As String, sUserName As String, sPasswd As String