mammouth
asked on
CInternetSession : undeclared identifier
With the code below, i always get: error C2065: 'CInternetSession' : undeclared identifier
Why?
CInternetSession session;
CHttpFile *httpFile = session->OpenURL("MonUrl/M ypage");
httpFile->Close();
Why?
CInternetSession session;
CHttpFile *httpFile = session->OpenURL("MonUrl/M
httpFile->Close();
ASKER
Now i get:
error C2819: type 'CInternetSession' does not have an overloaded member 'operator ->'
If i replace the "->" with "." i get
error C2440: 'initializing' : cannot convert from 'CStdioFile *' to 'CHttpFile *'
Please help
error C2819: type 'CInternetSession' does not have an overloaded member 'operator ->'
If i replace the "->" with "." i get
error C2440: 'initializing' : cannot convert from 'CStdioFile *' to 'CHttpFile *'
Please help
>>error C2440: 'initializing' : cannot convert from 'CStdioFile *' to 'CHttpFile *'
Um, 'OpenURL()' indeed returns that:
CStdioFile* OpenURL( LPCTSTR pstrURL, DWORD dwContext = 1, DWORD dwFlags = INTERNET_FLAG_TRANSFER_ASC II, LPCTSTR pstrHeaders = NULL, DWORD dwHeadersLength = 0 );
Are you thinking of
CInternetSession session;
CHttpConnection *httpConn = session.GetHttpConnection( ...);
CHttpFile *httpFile = httpConn->OpenRequest(...) ;
?
Um, 'OpenURL()' indeed returns that:
CStdioFile* OpenURL( LPCTSTR pstrURL, DWORD dwContext = 1, DWORD dwFlags = INTERNET_FLAG_TRANSFER_ASC
Are you thinking of
CInternetSession session;
CHttpConnection *httpConn = session.GetHttpConnection(
CHttpFile *httpFile = httpConn->OpenRequest(...)
?
ASKER
What i want to do, is get html content from a webpage into a variable like inet.openurl under vb.
CInternetSession session;
CHttpConnection *httpConn = session.GetHttpConnection( ...);
CHttpFile *httpFile = httpConn->OpenRequest(...) ;
give me error:
error C2661: 'CHttpConnection::OpenRequ est' : no overloaded function takes 1 arguments
CInternetSession session;
CHttpConnection *httpConn = session.GetHttpConnection(
CHttpFile *httpFile = httpConn->OpenRequest(...)
give me error:
error C2661: 'CHttpConnection::OpenRequ
You'll need to supply the correct arguments. BTW, you can read the content via a CStdioFile also:
CInternetSession session;
CStdioFile *httpFile = session.OpenURL("MonUrl/My page");
httpFile->Close();
CInternetSession session;
CStdioFile *httpFile = session.OpenURL("MonUrl/My
httpFile->Close();
ASKER
Which property of httpFile will contain content of MonUrl/Mypage ?
This code give no error, but i can't found content anywhere?
This code give no error, but i can't found content anywhere?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Does wininet will work behind a proxy?
Yes, it should.
#include <afxinet.h>