// VidWndCtrl.h : Declaration of the CContainerControl #ifndef __CONTAINERCONTROL_H_ #define __CONTAINERCONTROL_H_ #include "resource.h" // main symbols ///////////////////////////////////////////////////////////////////////////// // CContainerControl class ATL_NO_VTABLE CContainerControl : public CComObjectRootEx, public IDispatchImpl, public CComControl, public IPersistStreamInitImpl, public IPersistPropertyBagImpl, public IOleControlImpl, public IOleObjectImpl, public IOleInPlaceActiveObjectImpl, public IViewObjectExImpl, public IOleInPlaceObjectWindowlessImpl, public ISupportErrorInfo, public CComCoClass, public IObjectSafetyImpl { private: CComBSTR m_strProgIDOfControl; bool m_bInitialized; public: CContainerControl() { m_bInitialized = false; m_bWindowOnly = TRUE; } virtual HWND CreateControlWindow(HWND hWndParent, RECT& rcPos); DECLARE_REGISTRY_RESOURCEID(IDR_CONTAINERCONTROL) DECLARE_NOT_AGGREGATABLE(CContainerControl) DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(CContainerControl) COM_INTERFACE_ENTRY(IContainerControl) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(IObjectSafety) COM_INTERFACE_ENTRY(IViewObjectEx) COM_INTERFACE_ENTRY(IViewObject2) COM_INTERFACE_ENTRY(IViewObject) COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless) COM_INTERFACE_ENTRY(IOleInPlaceObject) COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless) COM_INTERFACE_ENTRY(IOleInPlaceActiveObject) COM_INTERFACE_ENTRY(IOleControl) COM_INTERFACE_ENTRY(IOleObject) COM_INTERFACE_ENTRY(IPersistStreamInit) COM_INTERFACE_ENTRY(IPersistPropertyBag) COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit) COM_INTERFACE_ENTRY(ISupportErrorInfo) END_COM_MAP() BEGIN_PROP_MAP(CContainerControl) PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4) PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4) // Example entries // PROP_ENTRY("Property Description", dispid, clsid) // PROP_PAGE(CLSID_StockColorPage) END_PROP_MAP() BEGIN_MSG_MAP(CContainerControl) //CHAIN_MSG_MAP(CComControl) DEFAULT_REFLECTION_HANDLER() 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); // ISupportsErrorInfo STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) { static const IID* arr[] = { &IID_IContainerControl, }; for (int i=0; i