home *** CD-ROM | disk | FTP | other *** search
- /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
- Copyright (c) 1998 Microsoft Corporation
-
- Module Name:
-
- tunesink.h
-
- Abstract:
-
- Definition of TuneIt AutoPC Sample Application's Event Sink and
- Class Message Sink.
-
- Environment:
-
- AutoPC
-
- -------------------------------------------------------------------*/
-
- #ifndef TUNESINK_H
- #define TUNESINK_H
-
- class CAppEventSink : public IASEventSink, public IASClassMsgSink
- {
- public:
- CAppEventSink() { m_cRef = 0; }
- ~CAppEventSink() {}
-
- //IUnknown methods, required for COM objects
- STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv); //Returns a point to requested interface
- STDMETHODIMP_(ULONG) AddRef(void); //Adds to the reference count
- STDMETHODIMP_(ULONG) Release(void); //Reduces reference count and deletes object if needed
-
- //IDispatch methods, a token implementation required for COM
- 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 Interface invoked when an event is fired
- STDMETHODIMP ReceiveMsg(long uMsg, long wParam, long lParam);
-
- //Class message sink methods
- 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 HandleKeyPress(IDispatch *pdispControl, long lKeyDown)
- { return S_FALSE; }
- STDMETHODIMP HandleLostFocus(IDispatch *pdispControl)
- { return S_FALSE; }
- // HandleMessage is the only method we implement
- STDMETHODIMP HandleMessage(IDispatch *pdispControl, long uMsg, long wParam, long lParam);
- STDMETHODIMP HandleStart(IDispatch *pdispControl)
- { return S_FALSE; }
-
- private:
- long m_cRef; // Objects reference count
-
- };
-
- #endif // TUNESINK_H