Writing an Internet Client Application Using MFC WinInet Classes

HomeOverviewHow Do I

The basis of every Internet client application is the Internet session. MFC implements Internet sessions as objects of class CInternetSession. Using this class, you can create one Internet session or several simultaneous sessions.

To communicate with a server, you need a CInternetConnection object as well as a CInternetSession. You can create a CInternetConnection by using CInternetSession::GetFtpConnection, CInternetSession::GetHttpConnection, or CInternetSession::GetGopherConnection. Each of these calls is specific to the protocol type. These calls do not open a file on the server for reading or writing. If you intend to read or write data, you must open the file as a separate step.

For most Internet sessions, the CInternetSession object works hand-in-hand with a CInternetFile object:

There are two ways to create a CInternetFile object:   

The steps in implementing an Internet client application vary depending on whether you create a generic Internet client based on OpenURL or a protocol-specific client using one of the GetConnection functions.

What do you know more about?