home *** CD-ROM | disk | FTP | other *** search
- /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- Copyright (c) 1998 Microsoft Corporation
-
- Module Name:
-
- appsink.h
-
- Abstract:
-
- SR App sample application message sink declarations. A CFormEventSink
- that will be attached to all the forms we create in our application,
- and a CAppMessageSink that will be attached to the forms manager.
-
- Environment:
-
- AutoPC
-
- -------------------------------------------------------------------*/
-
- #ifndef APPSINK_H
- #define APPSINK_H
-
- class CFormEventSink : public IASEventSink {
- public:
- // Constructor and Destructor
- CFormEventSink(DWORD AppThreadID);
- ~CFormEventSink() {};
-
- //IUnknown members.
- STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
- STDMETHODIMP_(ULONG) AddRef( VOID );
- STDMETHODIMP_(ULONG) Release( VOID );
-
- //IASEventSink members.
- STDMETHODIMP ReceiveMsg( LONG uMsg, LONG wParam, LONG lParam );
-
- // IDispatch methods (token implementation)
- STDMETHODIMP GetTypeInfoCount(UINT *pctInfo)
- {return E_NOTIMPL;}
- STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
- {return E_NOTIMPL;}
- STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispids)
- {return E_NOTIMPL;}
- STDMETHODIMP Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags,
- DISPPARAMS *pdispparams, VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr)
- {return E_NOTIMPL;}
-
- protected:
- LONG m_cRef; // this object's ref count
- DWORD m_AppThreadId; //Controlling app's thread ID.
- };
-
- class CAppMessageSink : public IASClassMsgSink, public IASEventSink
- {
- public:
- // Constructor and Destructor
- CAppMessageSink(DWORD AppThreadID);
- ~CAppMessageSink() {};
-
- // IUnknown methods
- STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
- STDMETHODIMP_(ULONG) AddRef( VOID );
- STDMETHODIMP_(ULONG) Release( VOID );
-
- // IASClassMsgSink methods
- // Handle message is the only one we hook into
- STDMETHODIMP HandleMessage(IDispatch* pdispControl, LONG uMsg, LONG wParam, LONG lParam);
- STDMETHODIMP HandleStart(IDispatch* pdispControl)
- {return S_FALSE;}
- STDMETHODIMP HandleClose(IDispatch* pdispControl)
- {return S_FALSE;}
- STDMETHODIMP HandleDraw(IDispatch* pdispControl, OLE_HANDLE hDC)
- {return S_FALSE;}
- STDMETHODIMP HandleKeyPress(IDispatch* pdispControl, LONG lKeyPress)
- {return S_FALSE;}
- STDMETHODIMP HandleGotFocus(IDispatch* pdispControl)
- {return S_FALSE;}
- STDMETHODIMP HandleLostFocus(IDispatch* pdispControl)
- {return S_FALSE;}
-
- // IDispatch methods (token implementation)
- STDMETHODIMP GetTypeInfoCount(UINT *pctInfo)
- {return E_NOTIMPL;}
- STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
- {return E_NOTIMPL;}
- STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispids)
- {return E_NOTIMPL;}
- STDMETHODIMP Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags,
- DISPPARAMS *pdispparams, VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr)
- {return E_NOTIMPL;}
-
- //IASEventSink member. We don't handle any messages though
- STDMETHODIMP ReceiveMsg(long uMsg, long wParam, long lPararm )
- {return NOERROR;}
-
- protected:
- LONG m_cRef; // this object's ref count
- DWORD m_AppThreadId; //Controlling app's thread ID.
- };
-
- #endif
-