## Internet Explorer Object Model

The Web browsing component of Internet Explorer (the Web browser control) is the core of what customers perceive as the Internet Explorer 3.0 application. Because it is implemented as an in-process COM server, the Web browser control must be hosted within some other process. For Internet Explorer 3.0, the hosting process is IEXPLORE.EXE; for Internet Explorer 4.0, the hosting process is the Windows shell.

The Web browser control hosts OLE document objects and fully implements OLE Hyperlinks, so from one perspective the Web browser control is a container, but it is also an OLE COM class object. As a COM class object, the Web browser control implements all the interfaces necessary to be an OLE control and can be contained within any OLE control container. Two special OLE control containers that are coded specifically to host the Web browser control are Internet Explorer 4.0, which hosts the browser as an additional "view" in the Windows shell, and the Internet Explorer 3.0 standalone application, which primarily provides a frame for the control.

As a rich OLE document object host, the Web browser control can host any OLE document object, with the added benefit of fully supporting hyperlinking to any document type.

Because the Web browser control implements the OLE Automation object model, a client application can programmatically control browsing. The Internet Explorer 3.0 frame exposes the control's Autmation object model through the Application object, and Internet Explorer 4.0 exposes the model through the Views collection property.

The Web browser control is implemented in SHDOCVW.DLL and has its own class identifier: CLSID_IExplorer.

There is another object that is related to the Web browser control: the component that implements the Automation interface to OLE Hyperlinks. CLSID_OAHyperLink is an in-proc class object that wraps the "COM level" hyperlinks accessed through the CreateHLinkFromData function (among others). Various methods and properties of the Web browser control pass references to OAHyperlinks.

The IWebBrowser interface is the primary OLE Automation compatible (dual) interface exposed by the Web browser control. IWebBrowser is also the logical 'base' interface for the IWebBrowserApp interface, which applications use to maniplute an instance of the Internet Explorer application though OLE Automation. In other words, IWebBrowserApp is a super-set of IWebBrowser.

### Printing from the Web Browser Control

Use the following steps to print the document that the Web browser control is currently displaying:

1. Retrieve the document object's IDispatch interface by calling IWebBrowser::get_Document.
2. Retrieve the document object's IOleCommandTarget interface by calling IDispatch::QueryInterface.
3. Print the document by calling IOleCommandTarget::Exec(NULL,OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, NULL,NULL). This function acts as though the Print menu item was chosen through the user interface.

© 1996 Microsoft Corporation