CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Mar 2003
    Location
    China
    Posts
    20

    A problem of getting web page using WinInet Class

    I just use HTTP Connection to get web page,it goes well when my url likes Url="http://www.google.com/",but when the Url="http://www.google.com/search?q=study" or something like this ,it returns no results.Here is part of my source code.

    CString Url;
    Url="http://www.google.com/search?q=study";
    // Opening the Url and getting a Handle for HTTP file
    hHttpFile = InternetOpenUrl(m_Session, (const char *) Url, NULL, 0, 0, 0);
    ::HttpQueryInfo(hHttpFile,HTTP_QUERY_CONTENT_LENGTH, szSizeBuffer, &dwLengthSizeBuffer, NULL) ;
    dwFileSize=atol(szSizeBuffer);
    LPSTR szContents = Contents.GetBuffer(dwFileSize);
    ::InternetReadFile(hHttpFile, szContents, dwFileSize, &dwBytesRead);
    ::InternetCloseHandle(hHttpFile); // Close the connection.
    Could someone help me?
    Thank you for your attention.
    ------------------------------------------------
    Regards
    Last edited by dengzh; April 2nd, 2003 at 05:45 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured