This topic has not yet been rated - Rate this topic

IOleObject::SetHostNames method

Applies to: desktop apps only

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

Minimum supported server

Windows 2000 Server

Header

OleIdl.h

IDL

OleIdl.Idl

IID

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

See also

IOleObject
IOleObject::GetUserType

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ