Thread: Error code 1813 after calling HttpOpenRequest

  1. #1
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532

    Error code 1813 after calling HttpOpenRequest

    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.
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

  2. #2
    C++ Enthusiast jmd15's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    532
    Has nobody else had this problem or know what is causing it? Or is WinInet not used very much, I would think it is but maybe not.
    Trinity: "Neo... nobody has ever done this before."
    Neo: "That's why it's going to work."
    c9915ec6c1f3b876ddf38514adbb94f0

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stack issues when calling a COM library
    By notnot in forum C Programming
    Replies: 3
    Last Post: 06-01-2009, 02:12 AM
  2. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  3. calling default instead of argument constructor, why?!
    By cppn00b in forum C++ Programming
    Replies: 6
    Last Post: 01-30-2005, 04:24 AM
  4. calling conventions
    By Micko in forum C Programming
    Replies: 2
    Last Post: 07-18-2004, 09:13 AM
  5. Question on function syntax and calling function
    By cbrman in forum C Programming
    Replies: 10
    Last Post: 10-05-2003, 05:32 PM