Article ID: 230770 - View products that this article applies to.
This article was previously published under Q230770
FrmVwr.exe includes a sample that demonstrates how to implement the IMAPIMessageSite, IMAPIViewContext, and IMAPIViewAdviseSink interfaces, that make up a FormViewer object. The sample was written with Microsoft Visual C++ and Microsoft Foundation Classes (MFC).
The following files are available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
Download FrmVwr.exe now
Collapse this imageExpand this image
119591Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
(http://support.microsoft.com/kb/119591/EN-US/ )How to Obtain Microsoft Support Files from Online Services
A common task in Extended MAPI is the displaying of forms. The IMAPISession object has two functions: PrepareForm and ShowForm, which are commonly used in conjunction to display a form. However, when a form is displayed in this manner it is modal to the application. In order to display a form that is non-modal, a Form Viewer must be implemented.
A MAPI Form Viewer is an object that consists of three interfaces: IMAPIMessageSite, IMAPIViewContext, and IMAPIViewAdviseSink. When these three interfaces are implemented, a form may appear with a call to IMAPIFormManager->LoadForm followed by a call to IMAPIForm->DoVerb. The Form Viewer, whose interfaces are passed as parameters to LoadForm, handles the details of showing the form and activating the Previous and Next buttons implemented in most built-in MAPI forms.
SetupFollow these steps to build the sample:
Running the SampleWhen the program starts, you are prompted to select a profile. After you've done this, the program opens the profile's inbox and displays a list of all the messages.
Double-clicking the From field of a message displays the form using the Form Viewer object. This form is in a non-modal window and the Previous and Next buttons are active.
To compare using a Form Viewer to using a Prepare Form/Show Form, select a message and click Open Modal from the Actions menu. Note that the application is blocked until this window is closed.
This sample also demonstrates how to implement IMAPIAdviseSink to maintain a current listing of messages in the Inbox.