GetHostObject PowerScript function
Description
Provides a reference to the context’s host object.
Host 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.
Controls
ContextInformation objects
Syntax
|
1 |
<span>servicereference</span>.<span>GetHostObject</span> ( <span>hostobject</span> ) |
|
Argument |
Description |
|---|---|
|
servicereference |
Reference to the Context Information |
|
hostobject |
PowerObject into which the function places |
Return Values
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
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:
|
1 |
Integer li_return |
|
1 |
|
1 |
li_return = ici_info.<span>GetHostObject</span>(ole1) |
|
1 |
IF li_return = 1 THEN |
|
1 |
sle_1.Text = "GetHostObject succeeded" |
|
1 |
ELSE |
|
1 |
sle_1.Text = "GetHostObject failed" |
|
1 |
cb_goback.Enabled = FALSE |
|
1 |
cb_navigate.Enabled = FALSE |
|
1 |
END IF |