Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 2.53 KB

steps-in-a-typical-internet-client-application.md

File metadata and controls

26 lines (22 loc) · 2.53 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Steps in a Typical Internet Client Application
Steps in a Typical Internet Client Application
11/04/2016
Internet client applications [MFC], general table
WinInet classes [MFC], programming
Internet applications [MFC], client applications
7aba135c-7c15-4e2f-8c34-bbaf792c89a6

Steps in a Typical Internet Client Application

The following table shows the steps you might perform in a typical Internet client application.

Your goal Actions you take Effects
Begin an Internet session. Create a CInternetSession object. Initializes WinInet and connects to server.
Set an Internet query option (time-out limit or number of retries, for example). Use CInternetSession::SetOption. Returns FALSE if operation was unsuccessful.
Establish a callback function to monitor the status of the session. Use CInternetSession::EnableStatusCallback. Establishes a callback to CInternetSession::OnStatusCallback. Override OnStatusCallback to create your own callback routine.
Connect to an Internet server, intranet server, or local file. Use CInternetSession::OpenURL. Parses the URL and opens a connection to the specified server. Returns a CStdioFile (if you pass OpenURL a local file name). This is the object through which you access data retrieved from the server or file.
Read from the file. Use CInternetFile::Read. Reads the specified number of bytes using a buffer you supply.
Handle exceptions. Use the CInternetException class. Handles all common Internet exception types.
End the Internet session. Dispose of the CInternetSession object. Automatically cleans up open file handles and connections.

See also

Win32 Internet Extensions (WinInet)
Prerequisites for Internet Client Classes
Writing an Internet Client Application Using MFC WinInet Classes