PInvoke 函数GetSystemMenu的调用导致堆栈不对称
'InternetGetConnectedState函数判断本机网络是否通畅出现这个其他信息: 对 PInvoke 函数“WindowsApplication3!WindowsApplication3.Form1::InternetGetConnectedState”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。
Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByVal lpszUrl As String, ByVal dwFlags As Integer, _
ByVal dwReserved As Integer) As Long
Public Const FLAG_ICC_FORCE_CONNECTION = &H1
'-------------------------------------------------------------------
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim n As Integer
Dim i As Integer
Dim a As String
n = TextBox3.Text
a = TextBox4.Text
For i = 1 To n
If InternetGetConnectedState("a", FLAG_ICC_FORCE_CONNECTION, 0) = 1 Then '0,Flash. 1,ture
Call duankai()
Else
Call lianjie()
End If
n = n - 1
Next
End Sub