IObjectStream Interface

Provides access to members used to make objects and object references persistant. Use of this interface allows multiple references to the same object to be stored properly.

Description

The IObjectStream interface provides properties and methods to allow you to correctly persist collections of ArcObjects objects in which there may be multiple references to a single object. For example if you persist both a Map and a LegendItem to the same stream, both may have references to a single layer. The ObjectStream ensures that the layer is only written to the persistence stream once. If you persist objects without an ObjectStream, you run the risk that the objects will be incorrectly rehydrated.

See the topics on implementing persistence for more details on implementing persistence on your custom objects with IObjectStream.

Members

Name Description
Method Clone
Method Commit
Method LoadObject Load an object from the specified stream. The first time an object is encountered, it is loaded from the stream. When subsequent references to the object are loaded, a pointer to the first object is returned.
Method LockRegion
Method RemoteCopyTo
Method RemoteRead
Method RemoteSeek
Method RemoteWrite
Method ReplaceObject Replaces the current object with the object in the the specified stream.
Method Revert
Method SaveObject Store an object to the specified stream. The first time the object is stored, the full object is written to the stream. When the object is subsequently stored, a reference is stored.
Method SetSize
Method Stat
Read/write property Stream The aggregated stream object.
Method UnlockRegion
Read/write property Version The software version for the stream.

IObjectStream.LoadObject Method

Load an object from the specified stream. The first time an object is encountered, it is loaded from the stream. When subsequent references to the object are loaded, a pointer to the first object is returned.

Public Function LoadObject ( _
    ByRef riid As Guid&, _
    ByVal pUnkOuter As Object _
) As Object
public object LoadObject (
    ref Guid& riid,
    ref object pUnkOuter
);

Remarks

The first parameter of LoadObject is a GUID of an interface ID (most of them could be find under HKEY_CLASSES_ROOT\Interface in the registry), not the object's GUID. The object that gets loaded will QI for this interface and the result is returned with the IUnknown parameter.

IObjectStream.ReplaceObject Method

Replaces the current object with the object in the the specified stream.

Public Sub ReplaceObject ( _
    ByVal unknown As Object _
)
public void ReplaceObject (
    object unknown
);

IObjectStream.SaveObject Method

Store an object to the specified stream. The first time the object is stored, the full object is written to the stream. When the object is subsequently stored, a reference is stored.

Public Sub SaveObject ( _
    ByVal pUnk As Object _
)
public void SaveObject (
    object pUnk
);

IObjectStream.Stream Property

The aggregated stream object.

Public Property Stream As IStream
public IStream Stream {get; set;}

IObjectStream.Version Property

The software version for the stream.

Public Property Version As String
public string Version {get; set;}

Inherited Interfaces

Interfaces Description
IStream
ISequentialStream

Classes that implement IObjectStream

Classes Description
ObjectStream Specialized kind of IStream for objects.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.