Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
InternetGetLastResponseInfo (wininet)
Retrieves the last error description or server response on the thread calling this function.

C# Signature:

[return: MarshalAs(UnmanagedType.Bool)]
static extern bool InternetGetLastResponseInfo(
   out int errorCode, StringBuilder buffer, ref int bufferLength);

VB Signature:

Declare Function InternetGetLastResponseInfo Lib "wininet.dll" Alias "InternetGetLastResponseInfoA" _
   (ByRef errorCode As Integer, ByVal buffer As String, ByRef bufferLength As Integer) _
   As <MarshalAs(UnmanagedType.Bool)> Boolean

User-Defined Types:




Tips & Tricks:

Please add some!

Sample Code:

  Private _errorCode As Integer = 0
  Private _buffSize As Integer = 0

  Private Function getLastResponse() As String

    'Call in once to get the size of the buffer we will need
    InternetGetLastResponseInfo(_errorCode, vbNullString, _buffSize)

    'Allocate space for the message
    Dim message As String = Space(_buffSize + 1)

    'Get the message
    InternetGetLastResponseInfo(_errorCode, message, _buffSize)

    Return message

  End Function

Alternative Managed API:

Do you know one? Please contribute it!


Direct Link:

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version