MFCMAPI as a Code Sample

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.

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.vcproj, 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.