SafeIUnknown.ToObject 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.
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
The wrapping object try-cast as type T, or null if this object is invalid or does not cast to T.