home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
msj
/
v10n04
/
olecont.exe
/
CNTLITEM.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-01
|
5KB
|
137 lines
///////////////////////////////////////////////////////////////////////////
// CNTLITEM.H -- Prototypes and declarations for the CControlItem class.
// This class processes OLE Custom Control Events and allows a
// container to add in event handling capability without a lot of fuss.
#ifndef __CNTLITEM_H__
#define __CNTLITEM_H__
///////////////////////////////////////////////////////////////////////////
// classes declared in this file.
// class COleClientItem; // MFC OLE Item Class
class CControlItem; // Provides OCX Container Item Support
///////////////////////////////////////////////////////////////////////////
// forward declarations
class CContainerDoc;
class CContainerView;
///////////////////////////////////////////////////////////////////////////
// class CControlItem
class CControlItem : public COleClientItem
{
DECLARE_SERIAL(CControlItem)
// Constructors
public:
CControlItem(CContainerDoc* pContainerDoc = NULL);
virtual ~CControlItem();
// Attributes
public:
// Event Information
DISPPARAMS m_LastParams;
DISPID m_EventID;
DISPPARAMS FAR* GetParams() { return &m_LastParams; };
protected:
// Attributes for the event connection and information
LPCONNECTIONPOINT m_pConnPt;
DWORD m_dwEventConnection;
USHORT m_nEvents;
EVENTINFO* m_pEventInfo;
LPDISPATCH m_pCtlDispatch;
// Attributes for the data binding notification connection
LPCONNECTIONPOINT m_pConnPtrBind;
DWORD m_dwBindConnection;
USHORT m_nBinds;
BINDINFO* m_pBindInfo;
public:
// Attributes for the OLE event interface
virtual LPUNKNOWN GetInterfaceHook(const void FAR* iid);
LPUNKNOWN GetCtlInterface(IID iidRequested);
protected:
IID m_iidEvents;
// Operations
public:
// Handler routines for Events and Property Notifications
// At some point, this could be replaced by maps, but not here.
virtual void OnEvent(DISPID dispID, DISPPARAMS FAR* pDispParams);
virtual HRESULT OnPropertyNotification(DISPID dispID, UINT idsOccurence);
void CleanUpParams();
void CopyParams(DISPPARAMS FAR* lpDispparams);
// Overrides
protected:
virtual BOOL FinishCreate(HRESULT hr);
virtual void Release(OLECLOSE dwCloseOption = OLECLOSE_NOSAVE);
// Implementation
protected:
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Control Initialization Routines
void InitControlInfo();
void InitEventInfo(LPTYPEINFO);
void InitBindInfo();
// Control Maintenance Routines
void FreeControlInfo();
EVENTINFO* GetEventInfo(MEMBERID memid);
PARAMPROPINFO* GetParamPropInfo(DISPID id);
// Implemented Interfaces
protected:
// Interface for Event Handling
BEGIN_INTERFACE_PART(EventHandler, IDispatch)
STDMETHOD(GetTypeInfoCount)(unsigned int FAR*);
STDMETHOD(GetTypeInfo)(unsigned int, LCID, ITypeInfo FAR* FAR*);
STDMETHOD(GetIDsOfNames)(REFIID, LPTSTR FAR*, unsigned int, LCID, DISPID FAR*);
STDMETHOD(Invoke)(DISPID, REFIID, LCID, unsigned short, DISPPARAMS FAR*,
VARIANT FAR*, EXCEPINFO FAR*, unsigned int FAR*);
END_INTERFACE_PART(EventHandler)
// Interface for Property Notifications
BEGIN_INTERFACE_PART(PropertyNotifySink, IPropertyNotifySink)
STDMETHOD(OnChanged)(DISPID dispid);
STDMETHOD(OnRequestEdit)(DISPID dispid);
END_INTERFACE_PART(PropertyNotifySink)
// Interface for Ambient Properties
BEGIN_INTERFACE_PART(AmbientProps, IDispatch)
STDMETHOD(GetTypeInfoCount)(unsigned int FAR*);
STDMETHOD(GetTypeInfo)(unsigned int, LCID, ITypeInfo FAR* FAR*);
STDMETHOD(GetIDsOfNames)(REFIID, LPTSTR FAR*, unsigned int, LCID, DISPID FAR*);
STDMETHOD(Invoke)(DISPID, REFIID, LCID, unsigned short, DISPPARAMS FAR*,
VARIANT FAR*, EXCEPINFO FAR*, unsigned int FAR*);
END_INTERFACE_PART(AmbientProps)
DECLARE_INTERFACE_MAP()
};
///////////////////////////////////////////////////////////////////////////
#endif // __CNTLITEM_H__
///////////////////////////////////////////////////////////////////////////