As of ATL 7.0, CComAutoThreadModule is obsolete: see ATL Module Classes for more details.
This class and its members cannot be used in applications that execute in the Windows Runtime.
[in] The class managing thread selection. The default value is CComSimpleThreadAllocator.
Selects a thread and then creates an object in the associated apartment.
(Static) Dynamically calculates the number of threads for the module based on the number of processors.
Creates the module's threads.
Increments the lock count on the module and on the current thread.
Decrements the lock count on the module and on the current thread.
CComAutoThreadModule derives from CComModule to implement a thread-pooled, apartment-model COM server for EXEs and Windows services. CComAutoThreadModule uses CComApartment to manage an apartment for each thread in the module.
Derive your module from CComAutoThreadModule when you want to create objects in multiple apartments. You must also include the DECLARE_CLASSFACTORY_AUTO_THREAD macro in your object's class definition to specify CComClassFactoryAutoThread as the class factory.
By default, the ATL COM AppWizard (the ATL Project Wizard in Visual Studio .NET) will derive your module from CComModule. To use CComAutoThreadModule, modify the class definition. For example: