the CComSingleThreadModel & the CComMultiThreadModel

 CComSingleThreadModel

class CComSingleThreadModel
{
public:
 static ULONG WINAPI Increment(LPLONG p) throw() {return ++(*p);}
 static ULONG WINAPI Decrement(LPLONG p) throw() {return --(*p);}
 typedef CComFakeCriticalSection AutoCriticalSection;
 typedef CComFakeCriticalSection AutoDeleteCriticalSection;
 typedef CComFakeCriticalSection CriticalSection;
 typedef CComSingleThreadModel ThreadModelNoCS;
};

 

This class provides methods for incrementing and decrementing the value of a variable.

http://blog.csdn.net/luckysym/article/details/622570

 

Typically, you use CComSingleThreadModel through one of two typedef names, either CComObjectThreadModel or CComGlobalsThreadModel. The class referenced by each typedef depends on the threading model used, as shown in the following table:

typedef Single threading model Apartment threading model Free threading model

CComObjectThreadModel

S

S

M

CComGlobalsThreadModel

S

M

M

S=CComSingleThreadModel; M=CComMultiThreadModel

 

你可能感兴趣的:(com)