Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SetHostNames Method

IOleObject::SetHostNames method

Provides an object with the names of its container application and the compound document in which it is embedded.

Syntax


HRESULT SetHostNames(
  [in] LPCOLESTR szContainerApp,
  [in] LPCOLESTR szContainerObj
);

Parameters

szContainerApp [in]

Pointer to the name of the container application in which the object is running.

szContainerObj [in]

Pointer to the name of the compound document that contains the object. If you do not wish to display the name of the compound document, you can set this parameter to NULL.

Return value

This method returns S_OK on success.

Remarks

Notes for Callers

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

Notes to Implementers

An object's application of IOleObject::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. Because 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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

OleIdl.h

IDL

OleIdl.Idl

IID

IID_IOleObject is defined as 00000112-0000-0000-C000-000000000046

See also

IOleObject
IOleObject::GetUserType

 

 

Community Additions

ADD
Show:
© 2015 Microsoft