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.

Table 19-10: OLE storage Member functions

Function

Result

MemberExists

Checks to see if the specified member exists in a storage.

Members can be either storages or streams. Names of members must be unique—you cannot have a storage and a stream with the same name. A member can exist but be empty.

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.)

boolean lb_exists
result = stg_data.MemberExists("subdata", lb_exists)
IF result = 0 AND lb_exists THEN
   result = stg_subdata.Open(stg_data, "subdata")
END IF

To use MemberExists with the storage member IOle10Native, use the following construction:

ole_storage.memberexists(char(1) + 'Ole10Native', &
   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:

ole_stream.open(ole_storage, char(1) + 'Ole10Native', &
   StgReadWrite!, StgExclusive!)