⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tapieventnotification.h

📁 基于Tapi 3.0的软电话源代码
💻 H
字号:
//-----------------------------------------------------------------------
//  Copyright (c) 2002 Avaya Global SME Solutions 
//-----------------------------------------------------------------------
//  Project name: TAPI 3 Test Harness
//  Module file : TAPIEventNotification.h
//  Compiler    : Visual C++ 6.0
//-----------------------------------------------------------------------
//  Description : Interface for the CTAPIEventNotification class.
//-----------------------------------------------------------------------

#if !defined(_TAPIEVENTNOTIFICATION_H)
#define _TAPIEVENTNOTIFICATION_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#define WM_TAPI_EVENT	 (WM_USER+1)

class CTAPIEventNotification : public  ITTAPIEventNotification
{
private:
    DWORD       m_dwRefCount;

public:

    //  CTAPIEventNotification implements ITTAPIEventNotification
    //  Declare ITTAPIEventNotification methods here
    HRESULT STDMETHODCALLTYPE Event(TAPI_EVENT TapiEvent, IDispatch *pEvent);

//  other COM stuff:
public:

    // constructor
    CTAPIEventNotification(DWORD dwThreadId);
    // destructor
    ~CTAPIEventNotification();

    // IUnknown implementation
	HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
    {
        if (iid == IID_ITTAPIEventNotification)
        {
            m_dwRefCount++;
            *ppvObject = (void *)this;
            return S_OK;
        }

        if (iid == IID_IUnknown)
        {
            m_dwRefCount++;            			
            *ppvObject = (void *)this;
            return S_OK;
        }

        return E_NOINTERFACE;
    }
	ULONG STDMETHODCALLTYPE AddRef()
    {
        m_dwRefCount++;
        return m_dwRefCount;
    }
    
	ULONG STDMETHODCALLTYPE Release()
    {
        ULONG l;
        
        l  = m_dwRefCount--;

        if ( 0 == m_dwRefCount)
        {
            delete this;
        }
        
        return l;
    }
};

#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -