mapicontact.h

来自「A (hopefully) complete extended MAPI wra」· C头文件 代码 · 共 85 行

H
85
字号
#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 + =
减小字号Ctrl + -
显示快捷键?