Marshal::SetComObjectData Method (Object^, Object^, Object^)
.NET Framework (current version)
Sets data referenced by the specified key in the specified COM object.
Assembly: mscorlib (in mscorlib.dll)
public: [SecurityCriticalAttribute] static bool SetComObjectData( Object^ obj, Object^ key, Object^ data )
Parameters
- obj
-
Type:
System::Object^
The COM object in which to store the data.
- key
-
Type:
System::Object^
The key in the internal hash table of the COM object in which to store the data.
- data
-
Type:
System::Object^
The data to set.
| Exception | Condition |
|---|---|
| ArgumentNullException | obj is null. -or- key is null. |
| ArgumentException | obj is not a COM object. -or- obj is a Windows Runtime object. |
All COM objects wrapped in a Runtime Callable Wrapper (RCW) have an associated hash table, to which SetComObjectData adds data. Marshal::GetComObjectData retrieves data from the hash table. You should never have to call either method from your code.
SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
.NET Framework
Available since 1.1
Available since 1.1
Show: