RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TOleContainer Class

TOleContainer embeds or links OLE objects.

Pascal
TOleContainer = class(TCustomControl, IUnknown, IOleClientSite, IOleInPlaceSite, IAdviseSink, IOleDocumentSite, IOleUIObjInfo);
C++
class TOleContainer : public TCustomControl, public IUnknown, public IOleClientSite, public IOleInPlaceSite, public IAdviseSink, public IOleDocumentSite, public IOleUIObjInfo;

OleCtnrs

Use TOleContainer to handle many of the complexities of OLE 2.0. TOleContainer lets the user choose an OLE object to insert by simply calling the InsertObjectDialog method. TOleContainer can create either an embedded OLE object or a linked OLE object.  

TOleContainer automatically handles menu merging -- the process of combining the container form's menu with that of an in-place activated OLE object's server application. The menu items' GroupIndex property settings control how menus are merged. Those main menu items with GroupIndex values of 0, 2, and 4 remain; TOleContainer merges the server application's menus and replaces the main menu items with GroupIndex values of 1, 3, and 5 (if they exist). 

OLE objects that are activated in-place add their server's toolbars directly into the container application's window. Normally, any panels used for toolbars are replaced by the OLE object's server's toolbars. Prevent this by setting a panel's Locked property to true. 

When using TOleContainer in an SDI application (the main form's FormStyle property is fsNormal rather than fsMDIForm), place the TOleContainer component inside a panel whose Align property is set to alClient. TOleContainer replaces an SDI form's toolbars as described above, and using a panel automatically adjusts the amount of space available to the OLE container. 

 

TForm 

TMainMenu 

TMenuItem 

TOleControl 

TPanel 

Creating Clients for Servers That Do Not Have a Type Library 

Active Documents 

Building COM Applications

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!