⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doc.h

📁 The source code samples for chapter 2, 4, 6, and 8 are contained in the EvenChapters project. Those
💻 H
字号:
// doc.h

#pragma once

///////////////////////////////////////////////////////////////////
// A document class: Stores string and handles file operations

template <typename MainWindow>
class CDocument : public CMessageMap {
public:
BEGIN_MSG_MAP(CMainWindow)

// Handle messages from the view and the main frame
ALT_MSG_MAP(MSG_CHAIN_ID)
  COMMAND_ID_HANDLER(ID_FILE_EXIT, OnFileExit)
END_MSG_MAP()

  CDocument(MainWindow* pwnd) : m_pwnd(pwnd) { *m_sz = 0; }

  void    SetString(LPCTSTR psz) { strcpy(m_sz, psz); }
  LPCTSTR GetString()            { return m_sz; }

  // Message chaining ID so view can route messages to the document
  enum { MSG_CHAIN_ID = 1340 };

// Message handlers
private:
  LRESULT OnFileExit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  {
    m_pwnd->DestroyWindow();
    return 0;
  }

private:
  MainWindow* m_pwnd;
  TCHAR       m_sz[64];
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -