📄 atlmod.h
字号:
#ifndef ATLMOD_H
#define ATLMOD_H
//
// Set the module class correctly, depending on whether we are an
// in-process or local server
//
#ifdef USE_ATL_INPROC
// Set our module class type
typedef CComModule QueATLModule;
#endif
#ifdef USE_ATL_LOCAL
// Check for double inclusion
#ifdef USE_ATL_INPROC
#error Specify USE_ATL_INPROC or USE_ATL_LOCAL, but not both.
#endif
//
// This is a local server. Unlock needs to be overriden
// so that the server can shut itself down when the server
// lock count reaches zero
//
class CExeModule : public CComModule
{
public:
// Ctor and dtor
CExeModule()
{
// Set our thread id
ulThreadID = GetCurrentThreadId();
}
// Overridden methods
LONG Unlock()
{
// Unlock ourself
LONG lLockCount = CComModule::Unlock();
// Was that the last one?
if (!lLockCount)
{
// Yep! Send our suicide message
PostThreadMessage(ulThreadID, WM_QUIT, 0, 0);
}
return lLockCount;
}
private:
ULONG ulThreadID;
};
// Set our module class type
typedef CExeModule QueATLModule;
#endif
// Declare the external module instance
extern QueATLModule _Module;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -