Syntax 4 For opening an OLE object in memory into a control
Description
Opens an OLE object that is in a OLE storage object in memory
and loads it into an OLE control.
Controls
OLE controls
Syntax
|
1 |
<span>olecontrol</span>.<span>Open</span> ( <span>sourcestorage</span>, <span>substoragename</span> ) |
|
Argument |
Description |
|---|---|
|
olecontrol |
The name of the OLE control into which |
|
sourcestorage |
The name of an object variable of OLEStorage |
|
substoragename |
A string specifying the name of a substorage |
Return Values
Integer. Returns 0 if it succeeds and
one of the following negative values if an error occurs:
-
-2 The parent storage
is not open -
-9 Other error
If any argument’s value is null, Open returns null.
Examples
This example opens the object in the substorage excel_obj
within the storage variable stg_stuff and
loads it into the control ole_1. Olest_stuff is
already open:
|
1 |
integer result |
|
1 |
result = ole_1.<span>Open</span>(stg_stuff, "excel_obj") |
This example opens a substorage in the storage variable stg_stuff and
loads it into the control ole_1. The
substorage name is specified in the variable stuff_1. Olest_stuff is
already open:
|
1 |
integer result |
|
1 |
string stuff_1 = "excel_obj" |
|
1 |
result = ole_1.<span>Open</span>(stg_stuff, stuff_1) |