MFCMAPI as a code sample
Applies to: Outlook 2013 | Outlook 2016
The MFCMAPI sample uses the Messaging API to provide access to MAPI stores through a graphical user interface. After you download this sample, you can use the source files to examine example usage cases for many of the MAPI interfaces and references. For more information, see MAPI Interfaces.
Property | Value |
---|---|
Platforms: |
Microsoft Visual Studio 2008 to compile for Windows 7, Windows Vista, Windows Server 2008, Windows XP SP2, and Windows Server 2003 SP1 |
To download MFCMAPI
On the latest MFCMAPI release page, navigate to Assets.
Click Source code (zip)
In the File Download dialog box, click Save. In the Save As dialog box, locate the folder in which you want to save the source files, and then click Save.
In the Download Complete dialog box, click Open Folder. You can also click Close to close the dialog box and locate the zipped source files in the folder that you saved them in.
Right-click the MFCMAPI-<version number>.zip file, and then click Extract All. In the dialog box that appears, click Extract to extract the files to the folder that is displayed. You can also click Browse to select or create a different folder.
Run Visual Studio 2008 as an administrator.
Note
If your computer is running Windows XP, you must be logged in as an administrator. If your computer is running Windows Vista, you must be logged in as an administrator and you must right-click the Visual Studio 2008 icon and then click Run as administrator.
In Visual Studio 2008, click File, point to Open, and then click Project/Solution.
Browse to the location where you saved the sample, select MFCMapi.vcxproj, and then click Open.
On the Build menu, click Build Solution.
In the Save File As dialog box, click Save.
To use MFCMAPI as a code sample
In Solution Explorer, expand the MFCMapi project and examine the files in the Header Files, Resource Files, and Source Files nodes for programming scenarios.
Many method topics in the MAPI Interfaces section point to MFCMAPI source files for programming examples. For example, in IMsgStore::GetReceiveFolderTable you are instructed to look at the function CMsgStoreDlg::OnDisplayReceiveFolderTable
in the MsgStoreDlg.cpp file.