Click to open or copy the COMMAP project files.
This basic sample shows how different COM interface map entry macros are used. This sample uses the smart pointer mechanism (_com_ptr_t) of Visual C++ native compiler COM support. The #import mechanism is used instead of the MIDL generated .h and .c files to provide marshaling information.
Build Aggreg.dll first, then build Commap.dll. CTLCOMM is an MFC wrapped VCCOM controller of the COMMAP ATL server. Use Commap.htm (an HTML file that uses VBScript) from Internet Explorer 3.0 or 4.0. Commap.htm includes comments about each type of map entry. You can also load the .vbp file into Visual Basic and run the program.
This sample demonstrates the following keywords:
dispinterface; #import; _com_ptr_t; _variant_t; _bstr_t; _com_error.
See also Compiler COM Support and ATL COMMAP sample.