wininet error messages
I'm trying to find out how to get the extended information from a ftp server if the error that is returned is 12003. I know that I'm supposed to use the internetgetlastresponseinfo function, but I don't know how to handle the string that is returned. Here is the code segment that deals with this.
DWORD errNo = 0,
errSize = 0;
CString errDesc = "";
errNo = GetLastError();
printf("No error found"); break;
InternetGetLastResponseInfo(&errNo, (LPTSTR) &errDesc, &errSize);
printf("Error 12003\nExtended information:\n%s\n", errDesc);
printf("Server was busy, please try again later");
printf("Firewall blocking connection to ftp server, please unblock and try again");
Well that's what indescriminate casting will get you.
> InternetGetLastResponseInfo(&errNo, (LPTSTR) &errDesc, &errSize);
Simply mushing things into the correct type doesn't make the code magically work.
Try something like this perhaps
DWORD bSize = 1000;
InternetGetLastResponseInfo(&error, buff, &bSize);
Thanks for the reply. I'll test it on monday when the person remotely is available.
Have a great weekend.
I can't seem to declare a variable as a type of TCHAR. I've tried to include Windows.h (can't do that because of the afxinet.h include), and tried to include tchar.h to no avail. Is there something that I'm supposed to include that will allow me to use the TCHAR type?
I found the error. Thanks for the help.