Return the user context (IVsUserContext interface) of an object.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'宣言
Function GetObjectContext ( _
punk As Object, _
<OutAttribute> ByRef ppctx As IVsUserContext _
) As Integer
'使用
Dim instance As IVsProvideUserContextForObject
Dim punk As Object
Dim ppctx As IVsUserContext
Dim returnValue As Integer
returnValue = instance.GetObjectContext(punk, _
ppctx)
int GetObjectContext(
Object punk,
out IVsUserContext ppctx
)
int GetObjectContext(
[InAttribute] Object^ punk,
[OutAttribute] IVsUserContext^% ppctx
)
function GetObjectContext(
punk : Object,
ppctx : IVsUserContext
) : int
Parameters
punk
Type: System.Object[in] Pointer to the IUnknown interface of the object.
ppctx
Type: Microsoft.VisualStudio.Shell.Interop.IVsUserContext%[out] Pointer to the user context (IVsUserContext) of the object.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From context.idl:
[C++]
HRESULT IVsProvideUserContextForObject::GetObjectContext(
[in] IUnknown * punk,
[out, retval] IVsUserContext ** ppctx
);
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsProvideUserContextForObject Interface