Share via


BEGIN_OBJECT_MAP

**BEGIN_OBJECT_MAP(**x )

Parameters

x

[in] Array of ATL object definitions.

Remarks

Marks the beginning of the map of ATL objects. The parameter x is an array holding _ATL_OBJMAP_ENTRY structures that describe the objects.

Start your object map with the BEGIN_OBJECT_MAP macro, add entries for each object with the OBJECT_ENTRY macro, and complete the map with the END_OBJECT_MAP macro. When CComModule::RegisterServer is called, it updates the system registry for each object in the object map.

Typically, you follow an object map definition with CComModule::Init to initialize the instance. For example, from the sample:

BEGIN_OBJECT_MAP(ObjectMap)
   OBJECT_ENTRY(CLSID_MyCircleCollectionCreator, CMyCircleCollectionCreator)
END_OBJECT_MAP( )

//DLL Entry Point
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
   if (dwReason == DLL_PROCESS_ATTACH)
   {
      _Module.Init(ObjectMap, hInstance);
      DisableThreadLibraryCalls(hInstance);
   }
   else if (dwReason == DLL_PROCESS_DETACH)
      _Module.Term();
   return TRUE;
}

See Also

ATL Macros and Global Functions