|
/*++
Copyright (c) 1999 - 2000 Microsoft Corporation. All Rights Reserved.
Module Name:
callnot.h
Abstract:
Declaration of the CTAPIEventNotification object
--*/
#ifndef __TAPIEventNotification_H__
#define __TAPIEventNotification_H__
#include <tapi3.h>
#include <strmif.h>
#include <control.h>
extern ITBasicCallControl * g_pCall;
extern HWND g_hDlg;
extern BSTR g_bstrVideo;
extern BOOL g_fAutoAnswer;
enum {
VWP_LEFT = 20,
VWP_TOP = 100
};
void DoMessage(LPWSTR pszMessage);
HRESULT OnTapiEvent(TAPI_EVENT TapiEvent,IDispatch * pEvent);
void HostWindow(IVideoWindow *pVideoWindow,int iWhere);
HRESULT GetVideoRenderTerminalFromStreamEvent(ITCallMediaEvent * pCallMediaEvent,ITTerminal ** ppTerminal,BOOL * pfRenderStream);
HRESULT OnTapiEvent(TAPI_EVENT TapiEvent,IDispatch * pEvent);
/////////////////////////////////////////////////////////////////////////////
// CTAPIEventNotification
class CTAPIEventNotification : public ITTAPIEventNotification
{
private:
LONG m_dwRefCount;
public:
// CTAPIEventNotification implements ITTAPIEventNotification
// Declare ITTAPIEventNotification methods here
HRESULT STDMETHODCALLTYPE Event(TAPI_EVENT TapiEvent,IDispatch * pEvent);
// other COM stuff:
public:
//
// constructor
//
CTAPIEventNotification()
{
m_dwRefCount = 1;
}
//
// destructor
//
~CTAPIEventNotification()
{
}
// IUnknown implementation
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
{
if (iid == IID_ITTAPIEventNotification)
{
AddRef();
*ppvObject = (void *)this;
return S_OK;
}
if (iid == IID_IUnknown)
{
AddRef();
*ppvObject = (void *)this;
return S_OK;
}
return E_NOINTERFACE;
}
//
// reference counting needs to be thread safe
//
ULONG STDMETHODCALLTYPE AddRef()
{
ULONG l = InterlockedIncrement(&m_dwRefCount);
return l;
}
ULONG STDMETHODCALLTYPE Release()
{
ULONG l = InterlockedDecrement(&m_dwRefCount);
if ( 0 == l)
{
delete this;
}
return l;
}
};
#endif //__TAPIEventNotification_H__
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.