home *** CD-ROM | disk | FTP | other *** search
- /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- Copyright (c) 1998 Microsoft Corporation
-
- Module Name:
-
- appsink.h
-
- Abstract:
-
- Keyboard Sample application sink definitions. Implements two classes,
- CFormEventSink and CAppMessageSink.
-
- Environment:
-
- AutoPC
-
- -------------------------------------------------------------------*/
-
- #ifndef APPSINK_H
- #define APPSINK_H
-
- /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- Class:
- CFormEventSink
-
- Description:
- Implements IASEventSink interface. Doesn't handle any messages
- (All of them are handled in the ClassMsgSink attached to the form
- manager)
- -------------------------------------------------------------------*/
- class CFormEventSink : public IASEventSink
- {
- public:
- // Constructor and empty destructor
- CFormEventSink(DWORD);
- ~CFormEventSink() {};
-
- //IUnknown methods
- STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
- STDMETHODIMP_(ULONG) AddRef();
- STDMETHODIMP_(ULONG) Release();
-
- //IASEventSink methods
- 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
-
- Description:
- ClassMsgSink and EventSink attached to the form Manager.
- -------------------------------------------------------------------*/
- class CAppMessageSink : public IASClassMsgSink, public IASEventSink
- {
- public:
- // Constructor and empty destructor
- CAppMessageSink(DWORD);
- ~CAppMessageSink() {};
-
- // IUnknown methods
- STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
- STDMETHODIMP_(ULONG) AddRef();
- STDMETHODIMP_(ULONG) Release();
-
- // IASClassMsgSink methods
- // HandleKeyPress and HandleMessage are the only two methods we are going
- // to do anything with.
- STDMETHODIMP HandleKeyPress(IDispatch* pdispControl, LONG lKeyPress);
- STDMETHODIMP HandleMessage(IDispatch* pdispControl, LONG uMsg, LONG wParam, LONG lParam);
- // The reset of the methods just return False to keep the message going down the pipe
- 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 HandleGotFocus(IDispatch* pdispControl)
- {return S_FALSE;}
- STDMETHODIMP HandleLostFocus(IDispatch* pdispControl)
- {return S_FALSE;}
-
- // IDispatch methods (token implementation)
- STDMETHODIMP GetTypeInfoCount(UINT *pctInfo)
- {return NOERROR;}
- STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
- {return NOERROR;}
- STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispids)
- {return NOERROR;}
- STDMETHODIMP Invoke(DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams, VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr)
- {return NOERROR;}
-
- // IASEventSink methods
- STDMETHODIMP ReceiveMsg( LONG uMsg, LONG wParam, LONG lParam );
-
- protected:
- LONG m_cRef; // This object's ref count
- DWORD m_AppThreadId; // Controlling app's thread ID.
- };
-
- #endif // APPSINK_H
-