Click to open or copy the COMMAP project files.
This basic sample shows how different COM interface map entry macros are used.
Running the Sample
Build Aggreg.dll first, then build Commap.dll. Use Commap.htm (an HTML file that uses VB Script) 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.
The COMMAP sample will not register correctly when its path contains spaces. One solution to this problem is to edit the corresponding .rgs file and add single quotes around all occurrences of %MODULE%. For example, you would change a line containing the following:
InprocServer32 = s %MODULE%
to the following:
InprocServer32 = s '%MODULE%'
This sample uses the following keywords:
BEGIN_COM_MAP; CComCoClass; CComModule::GetClassObject; CComModule::GetLockCount; CComModule::Init; CComModule::RegisterServer; CComModule::Term; CComModule::UnregisterServer; CComObjectRoot; CComTearOffObjectBase; COM_INTERFACE_ENTRY; COM_INTERFACE_ENTRY_AGGREGATE; COM_INTERFACE_ENTRY_AGGREGATE_BLIND; COM_INTERFACE_ENTRY_AUTOAGGREGATE; COM_INTERFACE_ENTRY_AUTOAGGREGATE_BLIND; COM_INTERFACE_ENTRY_CACHED_TEAR_OFF; COM_INTERFACE_ENTRY_TEAR_OFF; DECLARE_GET_CONTROLLING_UNKNOWN; DECLARE_REGISTRY_RESOURCEID; DisableThreadLibraryCalls; END_COM_MAP; IDispatchImpl; ISupportErrorInfo; SysAllocString