I was trying to retrieve a file using the wininet library. So I did all the necessary steps, like InternetOpen, InternetConnect,etc. Then I call HttpOpenRequest like this:
Code:
hHttpOpen=HttpOpenRequest(hHttpSession,NULL,"index.html",NULL,NULL,NULL,NULL,NULL);
hHttpOpen file doesn't return NULL so I try and call another function, either HttpAddRequestHeaders or HttpSendRequest and both of those fail. Any function called after HttpOpenRequest fails and I'm pretty sure it's because the handle returned from this function isn't correct. I did GetLastError and returned an error code of 1813. So you don't have to look it up this is what the description is on MSDN:
The specified resource type cannot be found in the image file.
I'm not doing anything with image files so why would I get this error? Am I incorrectly calling HttpOpenRequest? I used the syntax off MSDN? Thanks.