Click here to Skip to main content
15,885,141 members
Articles / Desktop Programming / ATL

ATL COM Based Addin / Plugin Framework With Dynamic Toolbars and Menus

Rate me:
Please Sign up or sign in to vote.
4.86/5 (35 votes)
9 Dec 20043 min read 164.5K   3.2K   96  
An article on ATL COM Based Addin / Plugin Framework With Dynamic Toolbars and Menus, based on VC++ Addin Architecture.
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINFRM_H__844C9AD7_A01E_49D3_B9C7_8896BDEEBCBD__INCLUDED_)
#define AFX_MAINFRM_H__844C9AD7_A01E_49D3_B9C7_8896BDEEBCBD__INCLUDED_

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



class CMainFrame : public CFrameWnd
{
	
protected: // create from serialization only
	CMainFrame();
	DECLARE_DYNCREATE(CMainFrame)
	CArray<ACCEL,ACCEL> m_AcceleratorArray;
// Attributes
public:
	
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMainFrame)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
	protected:
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
public:
	void SetStatusText(CString strStatus);
	BOOL RemoveCommands(UINT iCommand);
	BOOL LoadAditionalAccelerators();
	BOOL AddAccelerator(UINT iCommandID, CString strAccel);
	CMenu* FindMenu(CMenu *pMenu, CString strMenuString);
	BOOL LoadAllAddinCommands();
	BOOL GetToolText(HWND toolHandle, UINT nID, CString& strTipText, CString& strMessage );
	bool PFMergeAccelerator(HACCEL& hDestination, HACCEL hToMerge);
	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;
	CArray<CToolBar*,CToolBar*> m_pAddinToolbarArray;
// Generated message map functions
protected:
	//{{AFX_MSG(CMainFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnAddinAddinsettings();
	afx_msg void OnClose();
	afx_msg void OnAddinMenuItems(UINT iCommandID);
	afx_msg void OnUpdateAddinMenuItems(CCmdUI* pCmdUI);
	afx_msg void OnUpdateMenuItems(CCmdUI* pCmdUI);
	afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);

	afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu);
	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
	//}}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__844C9AD7_A01E_49D3_B9C7_8896BDEEBCBD__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Chief Technology Officer KTS INFOTECH PVT LTD
India India
->9+ Years of Experience in IT Field.
->Basically a C++ Programmer migrating to .NET
->Have Masters degree in Physics and Computer Scince.
-> Doing his Ph.D(Part Time) in Optical Networking)
->Interests: Software product development,Networking, Robotics,Sports Physics, Learning musical instruments, Cricket.

->Resides in kerala ,the gods own country, with his mother and wife.

Home page


Comments and Discussions