Retrieve the IServiceProvider interface for a file.
Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
Syntax
'Declaration
Function GetItemContext ( _
    pHier As IVsHierarchy, _
    itemid As UInteger, _
    <OutAttribute> ByRef ppServiceProvider As IServiceProvider _
) As Integer
int GetItemContext(
    IVsHierarchy pHier,
    uint itemid,
    out IServiceProvider ppServiceProvider
)
int GetItemContext(
    [InAttribute] IVsHierarchy^ pHier, 
    [InAttribute] unsigned int itemid, 
    [OutAttribute] IServiceProvider^% ppServiceProvider
)
abstract GetItemContext : 
        pHier:IVsHierarchy * 
        itemid:uint32 * 
        ppServiceProvider:IServiceProvider byref -> int
function GetItemContext(
    pHier : IVsHierarchy, 
    itemid : uint, 
    ppServiceProvider : IServiceProvider
) : int
Parameters
- pHier 
 Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy- [in] Pointer to the IVsHierarchy interface for the item. 
- itemid 
 Type: UInt32- [in] Integer. The identifier (VSITEMID) for the item. 
- ppServiceProvider 
 Type: Microsoft.VisualStudio.OLE.Interop.IServiceProvider%- [out] Pointer to an IServiceProvider interface for the item's file. 
Return Value
Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
.NET Framework Security
- 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.