Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q268470

↑ Back to the top


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).

↑ Back to the top


More information

The following file is available for download from the Microsoft Download Center:
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:

Collapse this tableExpand this table
File nameSize
Frameapp.cpp31 KB
Framedoc.cpp29 KB
Framer.ico2 KB
Framerex.dsp5 KB
Framerex.dsw1 KB
Framerex.exe48 KB
Framerex.h14 KB
Framerex.rc7 KB
Guids.cpp2 KB
Ipprevw.h3 KB
Paper.ico2 KB
Print.cpp13 KB
Resource.h2 KB
Winmain.cpp6 KB

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 "AS IS" 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.
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.

↑ Back to the top


References

For more information on ActiveX documents, see the Framer sample that ships with the Platform SDK.

For more information on interfaces such as IOleDocument, IOleDocumentSite, and IOleCommandTarget, search for these interface names at the following MSDN Web site:

↑ Back to the top


Keywords: kbdownload, kbactivedocs, kbfile, kbinfo, kbsample, KB268470

↑ Back to the top

Article Info
Article ID : 268470
Revision : 11
Created on : 1/27/2007
Published on : 1/27/2007
Exists online : False
Views : 640