GetHostObject

Description

Provides a reference to the context’s host object.

NoteHost object support Currently, host object support is implemented only in the window ActiveX when running under Internet Explorer. In this situation GetHostObject returns a reference to the IWebBrowserApp ActiveX automation server object.

Applies to

ContextInformation objects

Syntax

servicereference.GetHostObject ( hostobject )

Argument

Description

servicereference

Reference to the Context Information service instance

hostobject

PowerObject into which the function places a reference to the ActiveX automation server object

Returns

Integer. Returns 1 if the function succeeds and -1 if an error occurs.

Usage

Call this function to obtain a reference to the context object model. If running the window ActiveX under Internet Explorer 3.0 or greater and hostobject is an uninstantiated OleObject variable, the function returns a reference to an ActiveX automation server object, which you can use to control the hosting browser. If host object support is not available, the function returns -1 and hostobject is null.

Examples

Example 1

This example calls the GetHostObject function. Ici_info is an instance variable of type ContextInformation, which has been populated using the GetContextService function; ole1 is an instance variable of type OLEObject:

Integer li_return


li_return = ici_info.GetHostObject(ole1)

IF li_return = 1 THEN

    sle_1.Text = "GetHostObject succeeded"

ELSE

    sle_1.Text = "GetHostObject failed"

    cb_goback.Enabled = FALSE

    cb_navigate.Enabled = FALSE

END IF

See also