-1
Dim strMyNull As New System.Text.StringBuilder
Dim strCkUrl As String = "http://google.com"
Dim strCkNmNull As New System.Text.StringBuilder
Dim mystr As String = Space(192)
Dim strBuffer As New System.Text.StringBuilder(mystr)
strBuffer = strBuffer.Append(mystr)
Dim CkSz As Integer = Len(mystr)
Dim lReturn As Integer = 0


lReturn = ias.IEGetProtectedModeCookie(strCkUrl, vbNullString, strBuffer, CkSz, 0)

ias.IEGetProtectedModeCookie 在这里声明:

<System.Runtime.InteropServices.DllImport("ieframe.dll", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Unicode)> _
Public Function IEGetProtectedModeCookie(lpszURL As String, lpszCookieName As String, pszCookieData As System.Text.StringBuilder, ByRef pcchCookieData As Integer, dwFlags As UInteger) As UInteger
End Function
4

1 回答 1

1

IEGetProtectedModeCookie() 的返回值声明为UInteger,但您已将 lReturn 声明为Integer

UIinteger = 0 到 4,294,967,295

整数 = -2,147,483,648 到 2,147,483,647

IEGetProtectedModeCookie 的实际返回值需要为 Integer。

所以将函数声明更改为:

<System.Runtime.InteropServices.DllImport("ieframe.dll", SetLastError:=True, CharSet:=System.Runtime.InteropServices.CharSet.Unicode)> _
Public Function IEGetProtectedModeCookie(lpszURL As String, lpszCookieName As String, pszCookieData As System.Text.StringBuilder, ByRef pcchCookieData As Integer, dwFlags As UInteger) As Integer
End Function
于 2013-06-10T14:23:25.333 回答