Click here to Skip to main content
15,861,168 members
Articles / Desktop Programming / WTL

Form Designer

26 Jul 2021CPOL24 min read 349.8K   82.5K   230  
Component for adding scriptable forms capabilities to an application.
// FormPropertiesAccessor.h : Declaration of the CFormPropertiesAccessor
//
// Author : David Shepherd
//			Copyright (c) 2002, DaeDoe-Software
//
/////////////////////////////////////////////////////////////////////////////

#ifndef __FORMPROPERTIESACCESSOR_H_
#define __FORMPROPERTIESACCESSOR_H_

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CFormPropertiesAccessor
class ATL_NO_VTABLE CFormPropertiesAccessor :
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CFormPropertiesAccessor, &CLSID_FormPropertiesAccessor>,
	public IDispatchImpl<IFormPropertiesAccessor, &IID_IFormPropertiesAccessor, &LIBID_DDFORMSLib, TlbVerMaj, TlbVerMin>,
	public IConnectionPointContainerImpl<CFormPropertiesAccessor>,
	public IConnectionPointImpl<CFormPropertiesAccessor, &IID_IPropertyNotifySink>,
	public CFirePropNotifyEvent
{
private:
	// the form editor
	CComPtr<IFormEditor> m_spFormEditor;

public:
	CFormPropertiesAccessor()
	{
	}

DECLARE_NO_REGISTRY()

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CFormPropertiesAccessor)
	COM_INTERFACE_ENTRY(IFormPropertiesAccessor)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(IConnectionPointContainer)
END_COM_MAP()

BEGIN_CONNECTION_POINT_MAP(CFormPropertiesAccessor)
	CONNECTION_POINT_ENTRY(IID_IPropertyNotifySink)
END_CONNECTION_POINT_MAP()

// IFormPropertiesAccessor
public:
	STDMETHOD(put_FormEditor)(/*[in]*/ IFormEditor *pFormEditor);
	STDMETHOD(get_BackColor)(/*[out, retval]*/ OLE_COLOR *pVal);
	STDMETHOD(put_BackColor)(/*[in]*/ OLE_COLOR newVal);
	STDMETHOD(get_ForeColor)(/*[out, retval]*/ OLE_COLOR *pVal);
	STDMETHOD(put_ForeColor)(/*[in]*/ OLE_COLOR newVal);
};

#endif //__FORMPROPERTIESACCESSOR_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
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions