ALLINONE: Implements a Server Using ATL, Exposing STL Collections, Controlled by Compiler COM Support in an MFC Application

Click to open or copy the ALLINONE project files.

This sample demonstrates the ability of ATL/STL/VCCOM/MFC to coexist in a single application. Building on the COLLECT MFC example, nine collections are implemented in STL by using map, multimap, list, vector, deque and set. They are exposed as custom interfaces by using ATL with multiple types of aggregation. The MFC controller uses compiler COM support.

Compare this sample with the COLLECT MFC sample.

Running the sample

The Server:

  1. Build STLCOLL.DLL using the STLCOLL project in SAMPLES\COM\ALLINONE\SERVER.

  2. Self-registration should take place in the custom build step. Otherwise, run REGSVR32 Stlcoll.dll.

The Controller:  Build Collect.exe using the collect project in SAMPLES\COM\ALLINONE\COLLECT.

This sample demonstrates the following keywords:

map, vector, set, multimap, list, deque, _com_ptr_t, _bstr_t, _com_error

See also Compiler COM Support.