Click here to Skip to main content
15,895,667 members
Articles / Desktop Programming / ATL

ATL Splitter ActiveX control

Rate me:
Please Sign up or sign in to vote.
4.67/5 (6 votes)
16 Nov 1999CPOL4 min read 153.2K   2.4K   56  
A port of my splitter ActiveX control with MFC to ATL.
// SplitterPropPage.h : Declaration of the CSplitterPropPage

#ifndef __SPLITTERPROPPAGE_H_
#define __SPLITTERPROPPAGE_H_

#include "resource.h"       // main symbols

EXTERN_C const CLSID CLSID_SplitterPropPage;

/////////////////////////////////////////////////////////////////////////////
// CSplitterPropPage
class ATL_NO_VTABLE CSplitterPropPage :
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CSplitterPropPage, &CLSID_SplitterPropPage>,
	public IPropertyPageImpl<CSplitterPropPage>,
	public CDialogImpl<CSplitterPropPage>
{
public:
	CSplitterPropPage() 
	{
		m_dwTitleID = IDS_TITLESplitterPropPage;
		m_dwHelpFileID = IDS_HELPFILESplitterPropPage;
		m_dwDocStringID = IDS_DOCSTRINGSplitterPropPage;
	}

	enum {IDD = IDD_SPLITTERPROPPAGE};

DECLARE_REGISTRY_RESOURCEID(IDR_SPLITTERPROPPAGE)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CSplitterPropPage) 
	COM_INTERFACE_ENTRY(IPropertyPage)
END_COM_MAP()

BEGIN_MSG_MAP(CSplitterPropPage)
	CHAIN_MSG_MAP(IPropertyPageImpl<CSplitterPropPage>)
	COMMAND_HANDLER(IDC_CHECK_SYTLE, BN_CLICKED, OnClickedCheck_sytle)
	COMMAND_HANDLER(IDC_COMBO_FIRST, CBN_EDITCHANGE, OnEditchangeCombo_first)
	COMMAND_HANDLER(IDC_COMBO_FIRST, CBN_SELCHANGE, OnSelchangeCombo_first)
	COMMAND_HANDLER(IDC_COMBO_SECOND, CBN_EDITCHANGE, OnEditchangeCombo_second)
	COMMAND_HANDLER(IDC_COMBO_SECOND, CBN_SELCHANGE, OnSelchangeCombo_second)
	COMMAND_HANDLER(IDC_EDIT_POSITION, EN_CHANGE, OnChangeEdit_position)
	MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
END_MSG_MAP()
// Handler prototypes:
//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

	STDMETHOD(Apply)(void);
	LRESULT OnClickedCheck_sytle(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEditchangeCombo_first(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnSelchangeCombo_first(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEditchangeCombo_second(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnSelchangeCombo_second(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnChangeEdit_position(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
};

#endif //__SPLITTERPROPPAGE_H_

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions