_AFX_THREAD_STATE
{ AFX_MODULE_STATE* m_pModuleState; AFX_MODULE_STATE* m_PreModuleState; } 线程状态类AFX_MODULE_STATE
{ CWinApp* m_pCurentWinApp; HINSTANCE m_hCurrentInstanceHandle; HINSTANCE m_hCurrentResoureceHandle; LPCTSTR m_lpszCurrentAppName; //模块线程类 工作在当前模块中的线程 THREAD_LOCAL(AFX_MODULE_STATE,m_thread) == CThreadLocal<AFX_MODULE_THREAD_STATE> m_thread; } 模块状态类AFX_MODULE_THREAD_STATE
{ //当前模块运行的线程 CWinThread* m_CurrentWinthread; //当前窗口句柄表 CHandleMap* m_pmapHWND; CHandleMap* m_pmapHMENU; CHandleMap* m_pmapHDC; CHandleMap* m_pmapHGDIOBJ; CHandleMap* m_pmapHIMAGELIST; } 当前模块的线程状态类进程状态类
_AFX_BASE_MODULE_STATE全局
管理线程分配局部存储的空间 CThreadSlotData* _afxThreadData; 管理线程状态 CThreadLocal<_AFX_THREAD_STATE> _afxThreadState; 管理进程状态