标签:void span sign def 模板 ted oge dynamic log
class TableDlg : public CDialogEx { DECLARE_DYNAMIC(TableDlg) public: TableDlg(CWnd* pParent = nullptr); // 标准构造函数 virtual ~TableDlg(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_TABLE_DIALOG }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP() public: //获取单例,只允许当前创建一个对象 static TableDlg* GetTableDlg(); private: //只能实例化一个类 static TableDlg* m_pTableDlg; };
TableDlg* TableDlg::m_pTableDlg = nullptr; // TableDlg 对话框 IMPLEMENT_DYNAMIC(TableDlg, CDialogEx) TableDlg::TableDlg(CWnd* pParent /*=nullptr*/) : CDialogEx(IDD_TABLE_DIALOG, pParent) { Create(IDD_TABLE_DIALOG); } TableDlg::~TableDlg() { } void TableDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(TableDlg, CDialogEx) END_MESSAGE_MAP() TableDlg* TableDlg::GetTableDlg() { if (!m_pTableDlg) { m_pTableDlg = new TableDlg; } return m_pTableDlg; }
TableDlg *nTableDlg = TableDlg::GetTableDlg();
标签:void span sign def 模板 ted oge dynamic log
原文地址:https://www.cnblogs.com/ndyxb/p/13138246.html