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

📄 voipcallerinfodbenum.h

📁 一个WinCE6。0下的IP phone的源代码
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
// VoIPCallerInfoDBEnum.h : Declaration of the CVoIPCallerInfoDBEnum

#ifndef __VOIPCALLERINFODBENUM_H_
#define __VOIPCALLERINFODBENUM_H_

#include "DB.h"
#include <atlbase.h>
#include <atlcom.h>


class CVoIPCallerInfoDB;

//A FilterFn specifies which records can be returned to the users in an Enumeration:
//Return: S_OK - yes
//        S_FALSE - no
//        error code - failure so break the enumerator
typedef HRESULT FilterFn(IVoIPCallerInfoRecord *);

/////////////////////////////////////////////////////////////////////////////
// CVoIPCallerInfoDBEnum
class ATL_NO_VTABLE CVoIPCallerInfoDBEnum : 
    public CComObjectRootEx<CComMultiThreadModel>,
    public IVoIPCallerInfoDBEnum
{
public:
    // Constructor
    CVoIPCallerInfoDBEnum()
    {
        m_fInit = FALSE;
        m_pDB = NULL;
        m_pCallerInfoDB = NULL;
    }

public:
    // IVoIPCallerInfoDBEnum
    STDMETHOD (Next)(
        unsigned long celt, 
        IVoIPCallerInfoRecord **rgCallerInfoRecord, 
        unsigned long FAR* pceltFetched
        );
    
    STDMETHOD (Skip)(
        unsigned long celt
        );
    
    STDMETHOD (Reset)();

public:
    // Module-internal public methods
    HRESULT Init(
        CVoipDB *pDB,                    //the underlying CEDB
        CVoIPCallerInfoDB *pCallerInfoDB,//the owner of this record
        FilterFn            *pfnFilter   //the filter
        );


public:
    //FilterFn's that filter records returned in the enumerators

    //return S_OK for all non-null records
    static HRESULT  AcceptAll(IVoIPCallerInfoRecord *piRecord);

    //return S_OK for all records whose speed dial entry is not invalid
    static HRESULT  SpeedDialExists(IVoIPCallerInfoRecord *piRecord);

DECLARE_NO_REGISTRY()

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CVoIPCallerInfoDBEnum)
    COM_INTERFACE_ENTRY(IVoIPCallerInfoDBEnum)
END_COM_MAP()

// IVoIPCallerInfoDBEnum

private:
    CVoipDB                     *m_pDB;
    CVoIPCallerInfoDB           *m_pCallerInfoDB;
    BOOL                        m_fInit;

    //The function that determines whether the record is acceptable
    FilterFn                    *m_pfnFilter;
};

#endif //__VOIPCALLERINFODBENUM_H_

⌨️ 快捷键说明

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