IOleObject::SetHostNames (Windows CE 5.0)

Send Feedback

This method provides an object with the name of its container application and the compound document in which it is embedded.

HRESULT SetHostNames( LPCOLESTR szContainerApp, LPCOLESTR szContainerObj);

Parameters

  • szContainerApp
    [in] Null-terminated string that contains the name of the container application in which the object is running.

  • szContainerObj
    [in] Null-terminated string that contains the name of the compound document that contains the object.

    If you do not want to display the name of the compound document, set this parameter to NULL.

Return Values

S_OK indicates that the window title information set successfully.

Remarks

When a container initializes an embedded object, it calls this function to inform the object of the names of the container application and container document. When the object is opened for editing, it displays these names in the title bar of its window.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Notes to Callers

Call SetHostNames only for embedded objects, because for linked objects, the link source supplies its own separate editing window and title bar information.

Notes to Implementers

An object's application of SetHostNames should include whatever modifications to its user interface are appropriate to an object's embedded state. Such modifications typically include the following:

  • Adding and removing menu commands
  • 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 as follows:

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

Because these identifying strings are not stored as part of the persistent state of the object, SetHostNames must be called each time the object loads or runs.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Oleidl.h, Oleidl.idl.
Link Library: Oleaut32.lib, Uuid.lib.

See Also

IOleObject | Determining Supported COM APIs

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.