Internet Downloading Using Asynchronous Monikers

HomeOverviewHow Do I

The Internet requires new approaches to application design because of its slow network access. Applications should perform network access asynchronously to avoid stalling the user interface. The MFC class CAsyncMonikerFile provides asynchronous support for downloading files.

Advantages of Asynchronous Monikers

You can use asynchronous monikers to:

MFC Classes for Asynchronous Monikers

CAsyncMonikerFile is derived from CMonikerFile, which in turn is derived from COleStreamFile. A COleStreamFile object represents a stream of data; a CMonikerFile object uses an IMoniker to obtain the data, and a CAsyncMonikerFile object does so asynchronously.

Asynchronous monikers are used primarily in Internet-enabled applications and ActiveX controls to provide a responsive user interface during file transfers. A prime example of this is the use of CDataPathProperty to provide asynchronous properties for ActiveX controls.

MFC Classes for Data Paths in ActiveX Controls

The MFC classes CDataPathProperty and CCachedDataPathProperty implement ActiveX control properties that can be loaded asynchronously. Asynchronous properties are loaded after synchronous initiation. Asynchronous ActiveX controls repeatedly invoke a callback to indicate availability of new data during a lengthy property exchange process.

CDataPathProperty is derived from CAsyncMonikerFile. CCachedDataPathProperty is derived from CDataPathProperty. To implement asynchronous properties in your ActiveX controls, derive a class from CDataPathProperty or CCachedDataPathProperty, and override OnDataAvailable and other notifications you wish to receive.

What do you want to do?