System.Runtime.InteropServices.Marshal.SetComObjectData Method

Sets data referenced by the specified key in the specified COM object.

Syntax

public static bool SetComObjectData (object obj, object key, object data)

Parameters

obj
The COM object in which to store the data.
key
The key in the internal hash table of the COM object in which to store the data.
data
The data to set.

Returns

true if the data was set successfully; otherwise, false.

Remarks

All COM objects wrapped in a Runtime Callable Wrapper (RCW) have an associated hash table, to which Marshal.SetComObjectData(object, object, object) adds data. Marshal.GetComObjectData(object, object) retrieves data from the hash table. You should never have to call either method from your code.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0