madhosh
Programmer
- Aug 10, 2001
- 14
Hi Guys...
Need some help here.. I have been trying to acess web pages using C++ (MFC) . I have used following piece of code
CInternetSession init;
CHttpConnection* conn;
CHttpFile* file;
conn=init.GetHttpConnection( pstrServer, nPort,
pstrUserName, pstrPassword );
file=conn->OpenRequest(pstrVerb, pstrObjectName, pstrReferer , dwContext , pstrAcceptTypes , pstrVersion ,dwFlags);
file->SendRequest( pstrHeaders , dwHeadersLen , lpOptional , dwOptionalLen );
file->SetReadBufferSize(10000);
file->ReadString(str );
pstr=str.GetBuffer(10000);
but something seems to go wrong at ReadString Stage. I get following output no matter what website address i give
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
Can anyone help?? The verb iam using is "POST".
Need some help here.. I have been trying to acess web pages using C++ (MFC) . I have used following piece of code
CInternetSession init;
CHttpConnection* conn;
CHttpFile* file;
conn=init.GetHttpConnection( pstrServer, nPort,
pstrUserName, pstrPassword );
file=conn->OpenRequest(pstrVerb, pstrObjectName, pstrReferer , dwContext , pstrAcceptTypes , pstrVersion ,dwFlags);
file->SendRequest( pstrHeaders , dwHeadersLen , lpOptional , dwOptionalLen );
file->SetReadBufferSize(10000);
file->ReadString(str );
pstr=str.GetBuffer(10000);
but something seems to go wrong at ReadString Stage. I get following output no matter what website address i give
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
Can anyone help?? The verb iam using is "POST".