Compartir a través de


ATL Typedefs

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at ATL Typedefs.

The Active Template Library includes the following typedefs.

_ATL_BASE_MODULE Defined as a typedef based on _ATL_BASE_MODULE70.
_ATL_COM_MODULE Defined as a typedef based on _ATL_COM_MODULE70.
_ATL_MODULE Defined as a typedef based on _ATL_MODULE70.
_ATL_WIN_MODULE Defined as a typedef based on _ATL_WIN_MODULE70
ATL_URL_PORT The type used by CUrl for specifying a port number.
CComDispatchDriver This class manages COM interface pointers.
CComGlobalsThreadModel Calls the appropriate thread model methods, regardless of the threading model being used.
CComObjectThreadModel Calls the appropriate thread model methods, regardless of the threading model being used.
CContainedWindow This class is a specialization of CContainedWindowT.
CPath A specialization of CPathT using CString.
CPathA A specialization of CPathT using CStringA.
CPathW A specialization of CPathT using CStringW.
CSimpleValArray Represents an array for storing simple types.
DefaultThreadTraits The default thread traits class.
LPCURL A pointer to a constant CUrl object.
LPURL A pointer to a CUrl object.

_ATL_BASE_MODULE

Defined as a typedef based on _ATL_BASE_MODULE70.

typedef ATL::_ATL_BASE_MODULE70 _ATL_BASE_MODULE;   

Remarks

Used in every ATL project. Based on _ATL_BASE_MODULE70.

Classes that are part of the ATL 7.0 Module Classes derive from the _ATL_BASE_MODULE structure. For more information on ATL Module Classes, refer to COM Modules Classes.

_ATL_COM_MODULE

Defined as a typedef based on _ATL_COM_MODULE70.

typedef ATL::_ATL_COM_MODULE70 _ATL_COM_MODULE;   

Remarks

Used by ATL projects which use COM features. Based on _ATL_COM_MODULE70.

_ATL_MODULE

Defined as a typedef based on _ATL_MODULE70.

typedef ATL::_ATL_MODULE70 _ATL_MODULE;   

Remarks

Based on _ATL_MODULE70.

_ATL_WIN_MODULE

Defined as a typedef based on _ATL_WIN_MODULE70.

typedef ATL::_ATL_WIN_MODULE70 _ATL_WIN_MODULE; 
 

Remarks

Used by any ATL projects which use windowing features. Based on _ATL_WIN_MODULE70.

CComDispatchDriver

This class manages COM interface pointers.

typedef CComQIPtr<IDispatch, &__uuidof(IDispatch)> CComDispatchDriver;   

CComGlobalsThreadModel

Calls the appropriate thread model methods, regardless of the threading model being used.

#if defined(_ATL_SINGLE_THREADED)  
typedef CComSingleThreadModel CComGlobalsThreadModel;  
#elif defined(_ATL_APARTMENT_THREADED)  
typedef CComMultiThreadModel CComGlobalsThreadModel;  
#elif defined(_ATL_FREE_THREADED)  
typedef CComMultiThreadModel CComGlobalsThreadModel;  
#else  
#pragma message ("No global threading model defined")  
#endif   

Remarks

Depending on the threading model used by your application, the typedef name CComGlobalsThreadModel references either CComSingleThreadModel or CComMultiThreadModel. These classes provide additional typedef names to reference a critical section class.

Note

CComGlobalsThreadModel does not reference class CComMultiThreadModelNoCS.

Using CComGlobalsThreadModel frees you from specifying a particular threading model class. Regardless of the threading model being used, the appropriate methods will be called.

In addition to CComGlobalsThreadModel, ATL provides the typedef name CComObjectThreadModel. The class referenced by each typedef depends on the threading model used, as shown in the following table:

typedef Single threading Apartment threading Free threading
CComObjectThreadModel S S M
CComGlobalsThreadModel S M M

S= CComSingleThreadModel; M= CComMultiThreadModel

Use CComObjectThreadModel within a single object class. Use CComGlobalsThreadModel in an object that is globally available to your program, or when you want to protect module resources across multiple threads.

CComObjectThreadModel

Calls the appropriate thread model methods, regardless of the threading model being used.

#if defined(_ATL_SINGLE_THREADED)  
typedef CComSingleThreadModel CComObjectThreadModel;  
#elif defined(_ATL_APARTMENT_THREADED)  
typedef CComSingleThreadModel CComObjectThreadModel;  
#elif defined(_ATL_FREE_THREADED)  
typedef CComMultiThreadModel CComObjectThreadModel;  
#else  
#pragma message ("No global threading model defined")  
#endif   

Remarks

Depending on the threading model used by your application, the typedef name CComObjectThreadModel references either CComSingleThreadModel or CComMultiThreadModel. These classes provide additional typedef names to reference a critical section class.

Note

CComObjectThreadModel does not reference class CComMultiThreadModelNoCS.

Using CComObjectThreadModel frees you from specifying a particular threading model class. Regardless of the threading model being used, the appropriate methods will be called.

In addition to CComObjectThreadModel, ATL provides the typedef name CComGlobalsThreadModel. The class referenced by each typedef depends on the threading model used, as shown in the following table:

typedef Single threading Apartment threading Free threading
CComObjectThreadModel S S M
CComGlobalsThreadModel S M M

S= CComSingleThreadModel; M= CComMultiThreadModel

Use CComObjectThreadModel within a single object class. Use CComGlobalsThreadModel in an object that is either globally available to your program, or when you want to protect module resources across multiple threads.

CContainedWindow

This class is a specialization of CContainedWindowT.

typedef CContainedWindowT<CWindow> CContainedWindow;   

Remarks

CContainedWindow is a specialization of CContainedWindowT. If you want to change the base class or traits, use CContainedWindowT directly.

CPath

A specialization of CPathT using CString.

typedef CPathT<CString> CPath;   

CPathA

A specialization of CPathT using CStringA.

typedef CPathT<CStringA> CPathA;   

CPathW

A specialization of CPathT using CStringW.

typedef ATL::CPathT<CStringW> CPathW;   

CSimpleValArray

Represents an array for storing simple types.

#define CSimpleValArray CSimpleArray   

Remarks

CSimpleValArray is provided for creating and managing arrays containing simple data types. It is a simple #define of CSimpleArray.

LPCURL

A pointer to a constant CUrl object.

typedef const CUrl* LPCURL;   

LPURL

A pointer to a CUrl object.

typedef CUrl* LPURL;   

See Also

ATL COM Desktop Components
Functions
Global Variables
Structures
Macros
Classes