CComAutoCriticalSection

This class provides methods for obtaining and releasing ownership of a critical section object. CComAutoCriticalSection is similar to class CComCriticalSection, except CComAutoCriticalSection automatically initializes critical section objects in the constructor and deletes them in the destructor.

Typically, you use CComAutoCriticalSection through the typedef name AutoCriticalSection. This name references CComAutoCriticalSection when CComMultiThreadModel is being used.

Do not use CComAutoCriticalSection in global objects or static class members if you want to eliminate the CRT startup code. In this case, use CComCriticalSection.

At a Glance

Header file: Atlbase.h
Windows CE versions: 2.0 and later
Complete documentation: Visual C++ documentation

Syntax

class CcomAutoCriticalSection