Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 5: For opening an OLE object in a file into an OLEStorage – PB Docs 2019 – PowerBuilder Library

Syntax 5: For opening an OLE object in a file into an OLEStorage – PB Docs 2019

Syntax 5: For opening an OLE object in a file into an
OLEStorage

Description

Opens an OLE object in an OLE storage file and loads it into a
storage object in memory.

Applies to

OLE storage objects

Syntax

Argument

Description

olestorage

The name of an object variable of type OLEStorage into
which you want to load the OLE object.

OLEsourcefile

A string specifying the name of an OLE storage file
containing the object. The file must already exist and contain
OLE objects. OLEsourcefile can include the file’s path, as
well as path information within the storage.

readmode (optional)

A value of the enumerated datatype stgReadMode that
specifies the type of access you want for OLEsourcefile.
Values are:

  • stgReadWrite! — (Default) Read/Write access. If the
    file does not exist, Open creates it.

  • stgRead! — Read-only access. You cannot change
    OLEsourcefile.

  • stgWrite! — Write access. You can rewrite
    OLEsourcefile but not read its current contents. If the
    file does not exist, Open creates it.

sharemode (optional)

A value of the enumerated datatype stgShareMode that
specifies how other attempts, by your own or other
applications, to open OLEsourcefile will fare. Values
are:

  • stgExclusive! — (Default) No other attempt to open
    OLEsourcefile will succeed.

  • stgDenyNone! — Any other attempt to open
    OLEsourcefile will succeed.

  • stgDenyRead! — Other attempts to open OLEsourcefile
    for reading will fail.

  • stgDenyWrite — Other attempts to open OLEsourcefile
    for writing will fail.

Return value

Integer.

Returns 0 if it succeeds and one of the following negative values
if an error occurs:

-1 — The file is not an OLE storage file

-3 — The file is not found

-9 — Other error

If any argument’s value is null, Open returns null.

Usage

An OLE storage file is structured like a directory. Each OLE
object can contain other OLE objects (substorages) and other data
(streams). You can open the members of an OLE storage belonging to a
server application if you know the structure of the storage. However,
the PowerBuilder functions for manipulating storages are provided so
that you can build your own storage files for organizing the OLE objects
used in your applications.

The whole file can be an OLE object and substorages within the
file can also be OLE objects. More frequently, the structure for a
storage file you create is a root level that is not an OLE object but
contains independent OLE objects as substorages. Any level in the
storage hierarchy can contain OLE objects or be simply a repository for
another level of substorages.

Opening nested objects

Because you can specify path information within an OLE storage
with a backslash as the separator, you can open a deeply nested object
with a single call to Open. However, there is no error checking for
the path you specify and if the Open fails, you wo not know why. It is
strongly recommended that you open each object in the path until you
get to the one you want.

Examples

This example opens the object in the file MYSTUFF.OLE and loads it
into the OLEStorage variable stg_stuff:

This example opens the same object for reading:

This example opens the object in the file MYSTUFF.OLE and loads it
into the OLEStorage variable stg_stuff, as in the previous example. Then
it opens the substorage drawing_1 into a second storage variable, using
Syntax 6 of Open. This example does not include code to close and
destroy any of the objects that were opened.

This example opens the object in the file MYSTUFF.OLE and loads it
into the OLEStorage variable stg_stuff. Then it checks whether a stream
called info exists in the OLE object, and if so, opens it with read
access using Syntax 7 of Open. This example does not include code to
close and destroy any of the objects that were opened.

See also

Close

Save

SaveAs


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x