END_CLASS_MAP

 

The END_CLASS_MAP macro is provided to flag the end of the Map list.

 

Classes also may also be instanced without a call to CoCreateInstance. If your class does not need to be instanced through this procedure, you need not include it in the ClassMap. All an object needs to be instanced is its describing ClassItem, and this reference may be passed to the AllocObject method to create helper or internal COM objects.

 

A reference to a TypeLibInfo structure provided for in the ClassItem structure. TypeLibInfo defines the Type Library to be used for a class. Type Libraries are very important for this implementation, as the CoLib IDispatch interface implementation needs this type information to perform its tasks. This parameter may be left NULL for objects that do not support IDispatch. See MSDN regarding the ITypeInfo interface to discover how a type library can support IDispatch.

 

TypeLibInfo STRUCT

m_pIID_TYPELIB DWORD ; reference to the ID (refid) for

; this type lib

m_MajorVer DWORD ; Major Version of type lib

m_MinorVer DWORD ; Minor Version of type lib

TypeLibInfo ENDS

 

 

Each object that may be served from the project dll will need its particular TypeLibInfo.

 

An InterfaceMap is an array of InterfaceItem structures. This allows each object to define which interfaces it supports, and to be cast to any of these interfaces.

 

 

InterfaceMap:

InterfaceItem1 InterfaceItem{ }

InterfaceItem2 InterfaceItem { }

...

InterfaceItemN InterfaceItem{ }