Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Marshal::GetComObjectData Method (Object^, Object^)

 

Retrieves data that is referenced by the specified key from the specified COM object.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

public:
[SecurityCriticalAttribute]
static Object^ GetComObjectData(
	Object^ obj,
	Object^ key
)

Parameters

obj
Type: System::Object^

The COM object that contains the data that you want.

key
Type: System::Object^

The key in the internal hash table of obj to retrieve the data from.

Return Value

Type: System::Object^

The data represented by the key parameter in the internal hash table of the obj parameter.

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 have an associated hash table, which GetComObjectData retrieves. Marshal::SetComObjectData adds data to 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
Return to top
Show:
© 2017 Microsoft