Microsoft KB Archive/268470

= SAMPLE: FramerEx.exe Is an MDI ActiveX Document Container Sample Written in Visual C++ =

Article ID: 268470

Article Last Modified on 1/27/2007

-

APPLIES TO


 * Microsoft Excel 2000 Standard Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft PowerPoint 2000 Standard Edition
 * Microsoft Word 2000 Standard Edition
 * Microsoft Excel 2002 Standard Edition
 * Microsoft PowerPoint 2002 Standard Edition
 * Microsoft Word 2002 Standard Edition

-



This article was previously published under Q268470



SUMMARY
FramerEx.exe is a modified version of the Microsoft Platform Software Development Kit (SDK) Framer sample for ActiveX document hosting. FramerEx.exe is a multiple-document interface (MDI) host application that demonstrates how an ActiveX document container can host multiple documents and perform commonly requested operations, such as in-place print preview, opening and saving to existing Office documents (.doc, .xls, and .ppt files), in-place activation of Microsoft Visual Basic ActiveX documents (.vbd files), and even the hosting of HTML files (if Internet Explorer 4.0 or later is installed).



MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

FramerEx.exe

Release Date: September 5, 2000

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft 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. The self-extracting FramerEx.exe setup file contains the following files:

The FramerEx Sample
The FramerEx sample is written in Visual C++ 6.0 using the Platform SDK. It provides a basic example of how an MDI application can work as an ActiveX document host without using Microsoft Foundation Classes (MFC). It is designed to be as simple as possible to demonstrate just those elements that are important to ActiveX documents, and provides no functionality of its own. It does, however, demonstrate some of the more advanced features of ActiveX documents that are not covered by the Framer sample that ships with the Platform SDK.

If you are using Visual C++ version 6.0, you can simply open the project file and compile the application to build and run the program.

The example works with all ActiveX document servers, including Word documents (.doc files), Excel workbooks (.xls files), PowerPoint presentations (.ppt files), and Visual Basic ActiveX document projects (.vbd files). If you have Internet Explorer 4.0 or later installed, you can even open Web pages (.html files) in-place because Internet Explorer uses an ActiveX document server (Mshtml.dll) to view Web pages inside frames.

You have a royalty-free right to use, modify, reproduce, and distribute this sample application, and/or any modified version, in any way you find useful, provided that you agree that Microsoft has no warranty, obligations or liability for the code or information provided herein.

THE FRAMEREX SAMPLE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

In-place Print Preview
Among the features that are demonstrated by FramerEx is print preview. Developers should note that print previewing is NOT part of the ActiveX document specification, and there is no standard agreement on how preview should work for an ActiveX document container. Consequently, preview capabilities are not supported with all servers. It is up to your application to fail gracefully if previewing is not available.

However, beginning with Office 97, some Microsoft Office applications do support an interface called IInplacePrintPreview, which allows the ActiveX document server to preview an in-place object on behalf of the host. The interface was created (after the ActiveX document specification was made) for use by Microsoft Binder to support print previewing. This is NOT a formal addition to the ActiveX document specification, and not all ActiveX document servers support this interface. Nonetheless, it has been made public to allow developers to incorporate this feature when they work with specific Office applications. For more information on IInplacePrintPreview and its supporting IPreviewCallback callback interface, see the following Microsoft Developer Network (MSDN) Web site:

New OLE Interfaces for the Office 97 Binder

http://msdn.microsoft.com/library/en-us/dno97ta/html/msdn_binder97.asp

FramerEx demonstrates how to use IInplacePrintPreview to start a preview session, and implements IPreviewCallback to monitor preview status. You can use this technique for previewing Word, Excel and Visio documents inside custom applications. PowerPoint does not support in-place print previewing, but you can automate PowerPoint to start an in-place slide show.

