Share via


SafeIUnknown.ToObject Method

Definition

Overloads

ToObject()

Helper method to facilitate retrieving an instance of the type that represents the COM object whose IUnknown this class contains.

ToObject<T>()

Helper method to facilitate retrieving an instance of the type that represents the COM object whose IUnknown this class contains.

ToObject()

Helper method to facilitate retrieving an instance of the type that represents the COM object whose IUnknown this class contains.

public:
 System::Object ^ ToObject();
public:
 Platform::Object ^ ToObject();
winrt::Windows::Foundation::IInspectable ToObject();
public object ToObject ();
member this.ToObject : unit -> obj
Public Function ToObject () As Object

Returns

The wrapping object, or null if this object is invalid.

Applies to

ToObject<T>()

Helper method to facilitate retrieving an instance of the type that represents the COM object whose IUnknown this class contains.

public:
generic <typename T>
 where T : class T ToObject();
public:
generic <typename T>
 where T : class T ToObject();
template <typename T>
 where T : class T ToObject();
public T ToObject<T> () where T : class;
member this.ToObject : unit -> 'T (requires 'T : null)
Public Function ToObject(Of T As Class) () As T

Type Parameters

T

The type to try-cast the COM object to

Returns

T

The wrapping object try-cast as type T, or null if this object is invalid or does not cast to T.

Applies to