Browse - Programming Tips - How to use InternetGetLastResponseInfo from C/C++

Date: 2019may3
Platform: win32
Language: C/C++

Q.  How to use InternetGetLastResponseInfo from C/C++

A.

void GetExtendedInfo(LPSTR bufOut, const size_t sizeOut) { DWORD dwInetError; char buf[1024]; DWORD dwLocalSize = sizeof(buf); InternetGetLastResponseInfo(&dwInetError, buf, &dwLocalSize); _snprintf(bufOut, sizeOut, "InetError %d %s", dwInetError, buf); }
void ExampleUse() { DWORD dwError = GetLastError(); char szError[1024]; if (dwError == ERROR_INTERNET_EXTENDED_ERROR) { GetExtendedInfo(szError, sizeof(szError)); printf("%s\n", szError); } }