Syntax 7: For opening OLE streams – PB Docs 2017

Syntax 7: For opening OLE streams

Description

Opens a stream in an open OLE storage object and loads it into an
OLE stream object.

Applies to

OLE stream objects

Syntax

Argument

Description

olestream

The name of a object variable of type OLEStream
into which you want to load the OLE object.

sourcestorage

An OLE storage that contains the stream to be
opened.

streamname

A string specifying the name of the stream within
sourcestorage that you want to open.

readmode (optional)

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

  • stgReadWrite! — Read/write access. If
    streamname does not exist, Open creates it.

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

  • stgWrite! — Write access. You can rewrite
    streamname but not read its current contents. If
    streamname 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 streamname will fare. Values
are:

  • stgExclusive! — No other attempt to open
    streamname will succeed.

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

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

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

Return value

Integer.

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

-1 — Stream not found

-2 — Stream already exists

-3 — Stream is already open

-4 — Storage not open

-5 — Access denied

-6 — Invalid name

-9 — Other error

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

Examples

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. This example does not include code to close and destroy any of
the objects that were opened.

See also

Close


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