mainfrm.h

来自「《Visual C++视频技术方案宝典》配套光盘」· C头文件 代码 · 共 95 行

H
95
字号
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#include <afxtempl.h>
#if !defined(AFX_MAINFRM_H__F4BB7321_C13E_46EC_A589_620B24B8D737__INCLUDED_)
#define AFX_MAINFRM_H__F4BB7321_C13E_46EC_A589_620B24B8D737__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CPlugClass
{
protected:
	HICON   m_HIcon;                                //图标资源
	LPTSTR  m_Text;                                 //菜单和工具栏按钮的文本
public:
	virtual void  PlugDone() = 0;                   //插件执行的动作
	virtual HICON   GetIconRes() const = 0 ;        //获取图标资源
	virtual LPTSTR GetCmdText() const  = 0 ;        //获取菜单和工具栏按钮的文本	
	virtual void SetIconRes(int hIcon) = 0;         //设置菜单或工具栏按钮图标
	virtual void SetCmdText(LPTSTR CmdText) = 0;    //设置菜单和工具栏按钮的文本
	virtual void Release() = 0;
};

typedef BOOL  ( __stdcall *fCreatePlugObj)(void** pPlugObj);
typedef void  (__stdcall *fReleasePlugObj) (CPlugClass* pPlugObj);

struct CPlugMap
{
public:
	CPlugClass* m_PlugObj;        //插件对象
	HINSTANCE   m_DllInstance;    //动态库实例句柄

	CPlugMap(){;}
	~CPlugMap()
	{
		m_PlugObj->Release();
		FreeLibrary(m_DllInstance);
	}
}; 

class CMainFrame : public CFrameWnd
{
	
protected: // create from serialization only
	CMainFrame();
	DECLARE_DYNCREATE(CMainFrame)

// Attributes
public:
	CToolBar    m_PlugToolBar;             //插件工具栏
	CImageList  m_Images;                  //工具栏图像列表
	CList<CPlugMap*,CPlugMap*> m_PlugSet;  //插件集合

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMainFrame)
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation
public:
	BOOL OnPlugEvent(UINT nID);
	void LoadPlug();
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:  // control bar embedded members
	CStatusBar  m_wndStatusBar;
	CToolBar    m_wndToolBar;

// Generated message map functions
protected:
	//{{AFX_MSG(CMainFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnAddplug();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINFRM_H__F4BB7321_C13E_46EC_A589_620B24B8D737__INCLUDED_)

⌨️ 快捷键说明

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