NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Marshal.GetTypedObjectForIUnknown

Returns a managed object of a specified type that represents an unmanaged COM object. NOTE: Type T should be either a COM-imported Type or a sub-type of a COM-imported Type.

[Visual Basic]
Public Shared Function GetTypedObjectForIUnknown( _
   ByVal pUnk As Integer, _
   ByVal T As Type _
) As Object
[C#]
public static object GetTypedObjectForIUnknown(
   int pUnk,
   Type T
);
[C++]
public: static Object* GetTypedObjectForIUnknown(
   int pUnk,
   Type* T
);
[JScript]
public static function GetTypedObjectForIUnknown(
   pUnk : int,
   T : Type
) : Object;

Parameters

pUnk
Integer representing a pointer to the IUnknown interface of the unmanaged COM object.
T
Type object corresponding to the type of the managed class requested.

Return Value

An instance of the class corresponding to the Type object that represents the requested unmanaged COM object.

Remarks

The type represented by T must be a type whose metadata was imported by TLBIMP.

See Also

Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace