dengzh
April 2nd, 2003, 04:41 AM
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
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