Getting information about storage members
When a storage is open, you can use one of the Member functions
to get information about the substorages and streams in that storage
and change them.
Function |
Result |
---|---|
MemberExists |
Checks to see if the specified member Members can be either storages or streams. Names of members |
MemberDelete |
Deletes a member from a storage. |
MemberRename |
Renames a member in a storage. |
This code checks whether the storage subdata exists in stg_data before
it opens it. (The code assumes that stg_data and stg_subdata have
been declared and instantiated.)
1 |
boolean lb_exists<br>result = stg_data.MemberExists("subdata", lb_exists)<br>IF result = 0 AND lb_exists THEN<br>   result = stg_subdata.Open(stg_data, "subdata")<br>END IF |
To use MemberExists with the storage member
IOle10Native, use the following construction:
1 |
ole_storage.memberexists(char(1) + 'Ole10Native', &<br>   lb_boolean) |
The char(1)
is required
because the “I” in IOle10Native is not an I, as
you see if you look at the storage with a utility such as Microsoft’s
DocFile Viewer.
You need to use a similar construction to open the stream.
For example:
1 |
ole_stream.open(ole_storage, char(1) + 'Ole10Native', &<br>   StgReadWrite!, StgExclusive!) |