mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
MAPIEx: Updated interface
git-svn-id: svn://ultimatepp.org/upp/trunk@6416 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
2203d89b08
commit
d08dae7b40
18 changed files with 2079 additions and 2054 deletions
|
|
@ -1,54 +1,57 @@
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// File: MAPISink.cpp
|
||||
// Description: MAPI Advise Sink Wrapper
|
||||
//
|
||||
// Copyright (C) 2005-2011, 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
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Ported to U++ Framework by Koldo. See License.txt file
|
||||
|
||||
#include "MAPIEx.h"
|
||||
#include "MAPISink.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// MAPISink
|
||||
|
||||
MAPISink::MAPISink(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext) {
|
||||
m_lpfnCallback = lpfnCallback;
|
||||
m_lpvContext = lpvContext;
|
||||
m_nRef = 0;
|
||||
}
|
||||
|
||||
HRESULT MAPISink::QueryInterface(REFIID riid, LPVOID FAR* ppvObj) {
|
||||
if(riid == IID_IUnknown) {
|
||||
*ppvObj = this;
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
ULONG MAPISink::AddRef() {
|
||||
return InterlockedIncrement(&m_nRef);
|
||||
}
|
||||
|
||||
ULONG MAPISink::Release() {
|
||||
ULONG ul = InterlockedDecrement(&m_nRef);
|
||||
if(!ul)
|
||||
delete this;
|
||||
return ul;
|
||||
}
|
||||
|
||||
ULONG MAPISink::OnNotify(ULONG cNotification, LPNOTIFICATION lpNotifications) {
|
||||
if(m_lpfnCallback)
|
||||
m_lpfnCallback(m_lpvContext, cNotification, lpNotifications);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// File: MAPISink.cpp
|
||||
// Description: MAPI Advise Sink Wrapper
|
||||
//
|
||||
// Copyright (C) 2005-2011, 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
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Ported to U++ Framework by Koldo. See License.txt file
|
||||
|
||||
#include "MAPIEx.h"
|
||||
#include "MAPISink.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// MAPISink
|
||||
|
||||
MAPISink::MAPISink(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext) {
|
||||
m_lpfnCallback = lpfnCallback;
|
||||
m_lpvContext = lpvContext;
|
||||
m_nRef = 0;
|
||||
}
|
||||
|
||||
HRESULT MAPISink::QueryInterface(REFIID riid, LPVOID FAR* ppvObj) {
|
||||
if(riid == IID_IUnknown) {
|
||||
*ppvObj = this;
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
ULONG MAPISink::AddRef() {
|
||||
return InterlockedIncrement(&m_nRef);
|
||||
}
|
||||
|
||||
ULONG MAPISink::Release() {
|
||||
ULONG ul = InterlockedDecrement(&m_nRef);
|
||||
if(!ul)
|
||||
delete this;
|
||||
return ul;
|
||||
}
|
||||
|
||||
ULONG MAPISink::OnNotify(ULONG cNotification, LPNOTIFICATION lpNotifications) {
|
||||
if(m_lpfnCallback)
|
||||
m_lpfnCallback(m_lpvContext, cNotification, lpNotifications);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue