📄 app.h
字号:
#pragma once
#include "Resource.h"
#include "MainFrame.h"
class App : public CWinApp
{
public:
virtual BOOL InitInstance();
DECLARE_MESSAGE_MAP()
};
// CHS: 这个模板检查了函数的返回值,但并不是一个通用的异常处理的实现,
// 您的程序可能更应该使用合适自己的方式。
// ENG: This template is intended for checking the return value of the specified function.
// However it is not a generic expection handler.
// You may deal with expections in a more appropriate way.
template<class T> class check_ret
{
public:
T _ret_expected;
check_ret(const T &ret_expected)
: _ret_expected(ret_expected)
{
return;
}
friend const T & operator<<(const check_ret<T> &logger, const T &ret);
};
template<class T> inline const T & operator<<(const check_ret<T> &logger, const T &ret)
{
if (logger._ret_expected != ret)
{
OutputDebugString("An error occurs.\n");
}
return ret;
}
// CHS: 如果返回值不是0,输出错误。
// ENG: Invoke OutputDebugString if return value is not 0.
#define CHECK_RETURN check_ret<int>(0) <<
extern App app;
extern MainFrame* pFrame;
extern int conf_active;
extern HWND child_hwnd;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -