Marshal.GetComObjectData(Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves data that is referenced by the specified key from the specified COM object.
public:
static System::Object ^ GetComObjectData(System::Object ^ obj, System::Object ^ key);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static object? GetComObjectData (object obj, object key);
public static object GetComObjectData (object obj, object key);
public static object? GetComObjectData (object obj, object key);
[System.Security.SecurityCritical]
public static object GetComObjectData (object obj, object key);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetComObjectData : obj * obj -> obj
static member GetComObjectData : obj * obj -> obj
[<System.Security.SecurityCritical>]
static member GetComObjectData : obj * obj -> obj
Public Shared Function GetComObjectData (obj As Object, key As Object) As Object
Parameters
- obj
- Object
The COM object that contains the data that you want.
- key
- Object
The key in the internal hash table of obj
to retrieve the data from.
Returns
The data represented by the key
parameter in the internal hash table of the obj
parameter.
- Attributes
Exceptions
Remarks
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.