次の方法で共有


SafeIUnknown.ToObject<T> Method

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

Namespace:  Microsoft.VisualStudio.PlatformUI
Assembly:  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

'宣言
Public Function ToObject(Of T As Class) As T
'使用
Dim instance As SafeIUnknown
Dim returnValue As T

returnValue = instance.ToObject()
public T ToObject<T>()
where T : class
public:
generic<typename T>
where T : ref class
T ToObject()
member ToObject : unit -> 'T  when 'T : not struct
JScript does not support generic types or methods.

Type Parameters

  • T
    The type to try-cast the COM object to

Return Value

Type: T

.NET Framework Security

See Also

Reference

SafeIUnknown Class

SafeIUnknown Members

ToObject Overload

Microsoft.VisualStudio.PlatformUI Namespace