Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8924841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:31:36+00:00 2026-06-15T07:31:36+00:00

I am attempting to load HTML code using C++ and wininet.h instrumentation in Visual

  • 0

I am attempting to load HTML code using C++ and wininet.h instrumentation in Visual Studio 2010 Express. To create the URL String, I write the following:

HINTERNET hConnect =::InternetConnect(
    hInternet, 
    _T("stackoverflow.com"), 
    INTERNET_DEFAULT_HTTP_PORT, 
    NULL, 
    NULL, 
    IINTERNET_SERVICE_HTTP, 
    0, 
    1u
);

The program works well when the URL is just a domain with no path or protocol, but when I change the URL from stackoverflow.com to http://stackoverflow.com/questions, suddenly my code doesn’t work any longer.

HttpSendRequest(hRequest, NULL, 0, NULL, 0) simply returns false.

I have tried a number of different variations on my parameters and have scoured Google, but I am just plain stuck. Can anyone provide some insight?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:31:38+00:00Added an answer on June 15, 2026 at 7:31 am

    The documentation for InternetConnect tells me that it is used to establish an FTP or HTTP connection to a server – not to download a URL.

    As such, the lpszServerName parameter is documented as:

    Pointer to a null-terminated string that specifies the host name of an Internet server. Alternately, the string can contain the IP number of the site, in ASCII dotted-decimal format (for example, 11.0.1.45).

    So you must use a server’s host name or IP address and cannot use a URL, hence why it doesn’t work when you do.

    The path part of your URL (/questions) should be used as the lpszObjectName parameter of a HttpOpenRequest call (docs) that you make using the hConnect returned by your InternetConnect call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to following the tutorials found here: http://www.ifadey.com/2010/06/crud-using-jquery-and-codeigniter/ My code is updated to
So basically I am thinking about attempting load testing on my asp.net application using
Using NPOI and attempting to follow a tutorial here: http://www.zachhunter.com/2010/05/npoi-excel-template/ , I'm coming across
I am attempting to create a flipbook using jQuery Booklet plugin. I am following
I have an Android Webview where I load HTML into using loadDataWithBaseURL, some of
Im attempting to load a hex literal from an xml settings file, I can
I am attempting to load some images into a very basic C++/SDL based program.
I am attempting to load multiple images in AS3 and I'm exploring different options
I am attempting to load a table of shape coordinates out of a database
I am having an issue on my site where I am attempting to load

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.