OleSetHostNames

3.1

  #include <ole.h>    

  OLESTATUS OleSetHostNames(lpObject, lpszClient, lpszClientObj)    
  LPOLEOBJECT lpObject; /* address of object */
  LPCSTR lpszClient; /* address of string with name of client app */
  LPCSTR lpszClientObj; /* address of string with client's name for object */

The OleSetHostNames function specifies the name of the client application and the client's name for the specified object. This information is used in window titles when the object is being edited in the server application.

Parameters

lpObject

Points to the object for which a name is to be set.

lpszClient

Points to a null-terminated string specifying the name of the client application.

lpszClientObj

Points to a null-terminated string specifying the client's name for the object.

Return Value

The return value is OLE_OK if the function is successful. Otherwise, it is an error value, which may be one of the following:

OLE_BUSY
OLE_ERROR_MEMORY
OLE_ERROR_OBJECT
OLE_WAIT_FOR_RELEASE

The OleSetHostNames function returns OLE_ERROR_OBJECT when it is called for a linked object.

Comments

When a server application is started for editing of an embedded object, it displays in its title bar the string specified in the lpszClientObj parameter. The object name specified in this string should be the name of the client document containing the object.

A client application uses OleSetHostNames to set the name of an object the first time that object is activated or to change the name of an object. The client does not need to call OleSetHostNames every time a server is opened.