I am trying to simply access a page using the WinInet APIs. Once I access it, I'd like to be able to read the contents into a string. I've already initialized the root node. Here's what I got so far:
HINTERNET hChildURL = InternetOpenUrl(hInternetRoot,
LPCTSTR(CString("http://www.google.com/")),
NULL,
0,
0,
0);
After this, I know you have to utilize InternetReadFile to actually pull out the data. Can somebody provide a detailed example of how to do that. I'm not particularly familiar with C-style file functions and using buffers so please take it easy on me.
On another note, is there a different or more modern Windows API I should be using instead of ? In the long run, I've been assigned to develop an App that will act as a client and send/rec data using HTTP and HTTPS with a remote server. Am I going on the right path here?
Edit: To be more specific about requirements: It must be written in c++, it must be compatible with Win XP and onward, and it must utilize standard windows libraries only. Other than that I'm free to do as I please.