Click here to Skip to main content
15,861,125 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.
// EventSinkPassThrough.h : Declaration of the CEventSinkPassThrough
//
// Author : David Shepherd
//			Copyright (c) 2003, DaeDoe-Software
//
/////////////////////////////////////////////////////////////////////////////

#pragma once
#include "resource.h"       // main symbols

#include "DDForms.h"

/////////////////////////////////////////////////////////////////////////////
// forwards
class CEventSink;

/////////////////////////////////////////////////////////////////////////////
// CEventSinkPassThrough
class ATL_NO_VTABLE CEventSinkPassThrough :
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CEventSinkPassThrough, &CLSID_EventSinkPassThrough>,
	public IDispatch
{
// allow CEventSink direct access to all class members
friend CEventSink;

private:
	// the event sink
	CEventSink *m_pEventSink;
	// the event interface guid
	GUID m_EventInterfaceGuid;

	// custom query interface
	static HRESULT WINAPI _QI(void *pv,REFIID riid,LPVOID *ppv,DWORD dw);
	HRESULT QI(REFIID riid,LPVOID *ppv);

public:
	CEventSinkPassThrough();
	virtual ~CEventSinkPassThrough();

DECLARE_REGISTRY_RESOURCEID(IDR_EVENTSINKPASSTHROUGH)

BEGIN_COM_MAP(CEventSinkPassThrough)
	COM_INTERFACE_ENTRY(IUnknown)
	COM_INTERFACE_ENTRY_FUNC_BLIND(0,_QI)
END_COM_MAP()

DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct();
	void FinalRelease();

// IDispatch
public:
	STDMETHOD(GetIDsOfNames)(
		REFIID,OLECHAR FAR* FAR*,unsigned int,LCID,DISPID FAR*);
	STDMETHOD(GetTypeInfo)(unsigned int,LCID,ITypeInfo FAR* FAR*);
	STDMETHOD(GetTypeInfoCount)(unsigned int FAR*);
	STDMETHOD(Invoke)(
		DISPID dispIdMember,
		REFIID riid,
		LCID lcid,
		WORD wFlags,
		DISPPARAMS FAR* pDispParams,
		VARIANT FAR* pVarResult,
		EXCEPINFO FAR* pExcepInfo,
		unsigned int FAR* puArgErr);
};

OBJECT_ENTRY_NON_CREATEABLE_EX_AUTO(__uuidof(EventSinkPassThrough), CEventSinkPassThrough)

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