Click here to Skip to main content
15,915,864 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 9:32
Vikram A Punathambekar2-Mar-04 9:32 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 11:17
professionalRavi Bhavnani2-Mar-04 11:17 
GeneralRe: Getting content from HTML control Pin
David Crow2-Mar-04 7:29
David Crow2-Mar-04 7:29 
GeneralWriting large STL vectors to file Pin
inter8ection2-Mar-04 5:52
inter8ection2-Mar-04 5:52 
GeneralRe: Writing large STL vectors to file Pin
valikac2-Mar-04 18:06
valikac2-Mar-04 18:06 
GeneralRe: Writing large STL vectors to file Pin
inter8ection2-Mar-04 23:51
inter8ection2-Mar-04 23:51 
GeneralRe: Writing large STL vectors to file Pin
Robert A. T. Káldy3-Mar-04 1:18
Robert A. T. Káldy3-Mar-04 1:18 
GeneralQuestion using CHttpFile class. Pin
Chris Meech2-Mar-04 5:51
Chris Meech2-Mar-04 5:51 
I have some code that retrieves simple URL's as follows,
DWORD             nStatus          = NULL;
CHttpFile*        pFile            = NULL;
CHttpConnection*  pConn            = NULL;

CInternetSession  ISess;

pConn                             = ISess.GetHttpConnection(sz_Server);
pFile                             = pConn->OpenRequest(CHttpConnection::HTTP_VERB_GET, sz_ServiceURL);
pFile->SendRequest();
pFile->QueryInfoStatusCode(nStatus);

if ( nStatus == HTTP_STATUS_OK )
{
   CString         strBuff;
   CString         strRead;

   while ( pFile->ReadString(strRead) )
   {
        strBuff                    += strRead;
   }

   cout << (LPCTSTR)strBuff << endl;
}


I would like to remove the looping reading and replace it with a single read. But I'm not able to figure out how big a buffer to allocate. Is there some method of the CHttpFile class that I could use that would give me the amount of data to expect. I've tried the GetLength method, but this is not returning the correct value. Thanks.


Chris Meech

We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton

VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
GeneralWindows XP Theme Conflict Pin
Jnewg52-Mar-04 5:29
Jnewg52-Mar-04 5:29 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn2-Mar-04 9:01
sitebuilderMichael Dunn2-Mar-04 9:01 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg53-Mar-04 5:36
Jnewg53-Mar-04 5:36 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn3-Mar-04 6:41
sitebuilderMichael Dunn3-Mar-04 6:41 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg511-Mar-04 3:14
Jnewg511-Mar-04 3:14 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn12-Mar-04 4:28
sitebuilderMichael Dunn12-Mar-04 4:28 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg512-Mar-04 15:22
Jnewg512-Mar-04 15:22 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn12-Mar-04 16:45
sitebuilderMichael Dunn12-Mar-04 16:45 
Generalprinting your source code Pin
BlackDice2-Mar-04 5:28
BlackDice2-Mar-04 5:28 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 6:05
John M. Drescher2-Mar-04 6:05 
GeneralRe: printing your source code Pin
BlackDice2-Mar-04 6:16
BlackDice2-Mar-04 6:16 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 6:54
John M. Drescher2-Mar-04 6:54 
GeneralRe: printing your source code Pin
BlackDice2-Mar-04 6:58
BlackDice2-Mar-04 6:58 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 8:08
John M. Drescher2-Mar-04 8:08 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 8:20
John M. Drescher2-Mar-04 8:20 
GeneralPassing Data between threads Pin
Tom Wright2-Mar-04 4:19
Tom Wright2-Mar-04 4:19 
GeneralRe: Passing Data between threads Pin
Prakash Nadar2-Mar-04 4:25
Prakash Nadar2-Mar-04 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.