Provides an object with the name of its container application and the compound document in which it is embedded.
HRESULT SetHostNames(
LPCOLESTR szContainerApp, //Pointer to name of container
// application
LPCOLESTR szContainerObj //Pointer to name of container document
);
When a container initializes an embedded object, it calls this function to inform the object of the names of both the container application and container document. When the object is opened for editing, it displays these names in the title bar of its window.
Call SetHostNames only for embedded objects, because for linked objects, the link source supplies its own separate editing window and title bar information.
An object's application of SetHostNames should include whatever modifications to its user interface may be appropriate to an object's embedded state. Such modifications typically will include adding and removing menu commands and altering the text displayed in the title bar of the editing window.
The complete window title for an embedded object in an SDI container application or an MDI application with a maximized child window should appear as follows:
<object application name> – <object short type> in <container document>
Otherwise, the title should be:
<object application name> – <container document>
The "object short type" refers to a form of an object's name short enough to be displayed in full in a list box.
Since these identifying strings are not stored as part of the persistent state of the object, IOleObject::SetHostNames must be called each time the object loads or runs.
Windows NT: Use version 3.1 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in oleidl.h.