📄 mapicontact.h
字号:
#ifndef __MAPICONTACT_H__
#define __MAPICONTACT_H__
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// File: MAPIContact.h
// Description: MAPI Contact class 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
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
class CMAPIEx;
class CMAPIContact;
/////////////////////////////////////////////////////////////
// CContactAddress
class AFX_EXT_CLASS CContactAddress : public CObject
{
public:
CContactAddress();
enum AddressType { BUSINESS, HOME, OTHER, MAX_ADDRESS_TYPES };
// Attributes
public:
CString m_strStreet;
CString m_strCity;
CString m_strStateOrProvince;
CString m_strPostalCode;
CString m_strCountry;
// Operations
public:
void FillAddress(CMAPIContact& contact,AddressType nType);
};
/////////////////////////////////////////////////////////////
// CMAPIContact
class AFX_EXT_CLASS CMAPIContact : public CObject
{
public:
CMAPIContact();
~CMAPIContact();
// Attributes
protected:
CString m_strSubject;
CMAPIEx* m_pMAPI;
LPMAILUSER m_pUser;
SBinary m_entry;
// Operations
public:
void SetEntryID(SBinary* pEntry=NULL);
SBinary* GetEntryID() { return &m_entry; }
BOOL Open(CMAPIEx* pMAPI,SBinary entry);
void Close();
void GetPropertyString(CString& strProperty,ULONG ulProperty);
void GetName(CString& strName,int nNameID=PR_DISPLAY_NAME);
void GetEmail(CString& strEmail);
void GetPhoneNumber(CString& strPhoneNumber,int nPhoneNumberID);
void GetAddress(CContactAddress& address,CContactAddress::AddressType nType);
void GetAddress(CString& strAddress);
void GetNotes(CString& strNotes,BOOL bRTF=FALSE);
LPCTSTR GetSubject() { return m_strSubject; }
protected:
HRESULT GetProperty(ULONG ulProperty, LPSPropValue &prop);
friend CContactAddress;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -