OleMainWindow
OleMainWindow is a subclass of CwMainWindow. It extends the functionality of a main window to support menu-bar negotiation when an object is activated in place. You must use an OleMainWindow instead of CwMainWindow in any application that embeds or links OLE objects or uses OCXs.
When an embedded OLE object is activated in place, the menu bar for the container becomes a mixture of the container's current menus and the menus provided by the server. Menu-bar items are divided into these groups:
• File
• Edit
• Container
• Object
• Window
• Help
When an object is activated in place, the container provides these groups:
• File
• Container
• Window
The server provides these groups:
• Edit
• Object
• Help
A container provides the OleMainWindow with the pull-down menus for each of the groups it is responsible for. For example, a container might specify its in-place menu-bar groups as follows:
anOleMainWindow
fileMenuGroup: (Array with: fileMenuCascade);
containerMenuGroup: (Array with: optionsMenuCascade with: featuresMenuCascade);
windowMenuGroup: (Array with: windowMenuCascade)
Hence, when an embedded OLE object is activated in place, a merged menu bar is built and managed by the OleMainWindow--first using the menus specified by the container, and then querying the server for its menu groups. In addition, real estate in the container's OleMainWindow is negotiated for any tool bars and floating palettes that the server provides for editing the object. When the embedded object is deactivated, the original menu bar of the OleMainWindow is restored along with any window areas used by the server for tool bars and so on.
Last modified date: 01/29/2015