Case Study: Wrapping a Class for Downloading Web Pages

An important use of classes is that they can provide a convenient wrapper around an existing Application Programming Interface (API). APIs in Windows (as in most operating systems) are collections of functions that must be called in a particular sequence. When the API is thus wrapped up as a class, such a class becomes independent of the precise details of that API and can be ported with little fuss to some other platform. Also, as you will see, the resulting class is often much easier to use than the original code.

Using the WinInet API to Access Web Pages

The example in this case study is the WinInet Win32 API, which is a set of high-level functions that implement the raw business of WinSock ...

Get C++ By Example: UnderC Learning Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.