📄 mapisink.cpp
字号:
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// File: MAPISink.cpp
// Description: MAPI Advise Sink Wrapper
//
// Copyright (C) 2005-2006, Noel Dillabough
//
// This source code is free to use and modify provided this notice remains intact and that any enhancements
// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit.
//
// Usage: see the Codeproject article at http://www.codeproject.com/internet/CMapiEx.asp
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "MAPIExPCH.h"
#include "MAPISink.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CMAPISink
CMAPISink::CMAPISink(LPNOTIFCALLBACK lpfnCallback,LPVOID lpvContext)
{
m_lpfnCallback=lpfnCallback;
m_lpvContext=lpvContext;
m_nRef=0;
}
HRESULT CMAPISink::QueryInterface(REFIID riid,LPVOID FAR* ppvObj)
{
if(riid==IID_IUnknown) {
*ppvObj=this;
AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
ULONG CMAPISink::AddRef()
{
return InterlockedIncrement(&m_nRef);
}
ULONG CMAPISink::Release()
{
ULONG ul=InterlockedDecrement(&m_nRef);
if(!ul) delete this;
return ul;
}
ULONG CMAPISink::OnNotify(ULONG cNotification,LPNOTIFICATION lpNotifications)
{
if(m_lpfnCallback) m_lpfnCallback(m_lpvContext,cNotification,lpNotifications);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -