头文件声明(CAutoLock.h): #ifndef AUTO_LOCKER_HEAD_FILE #define AUTO_LOCKER_HEAD_FILE #pragma once //数据锁定 class CAutoLocker { //变量定义 private: INT m_nLockRef; //锁定计数 CCriticalSection & m_CriticalSection; //锁定对象 //函数定义 public: //构造函数 CAutoLocker(CCriticalSection & CriticalSection