kave
kave

Reputation: 471

How to use InternetGetLastResponseInfo in C

I have big problems using the InternetGetLastResponseInfo function because of all the weird file types.

Can anyone give me some short example code showing how to use it and printing the Error afterwards (in C)?

Edit: Found it out now

Upvotes: 0

Views: 3778

Answers (1)

kave
kave

Reputation: 471

Works now. Code:

DWORD error = GetLastError();
printf("Error: %d\n", error);
DWORD dwInetError;
DWORD dwExtLength = 1000;
TCHAR *szExtErrMsg = NULL;
TCHAR errmsg[1000];
szExtErrMsg = errmsg;
int returned = InternetGetLastResponseInfo( &dwInetError, szExtErrMsg, &dwExtLength );
printf("dwInetError: %d  Returned: %d\n", dwInetError, returned);
_tprintf(_T("Buffer: %s\n"), szExtErrMsg);

Upvotes: 3

Related Questions