Partager via


IVsSolutionBuildManager.GetProjectDependencies Method

Returns a list of projects that the given hierarchy depends on.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Déclaration
Function GetProjectDependencies ( _
    pHier As IVsHierarchy, _
    celt As UInteger, _
    <OutAttribute> rgpHier As IVsHierarchy(), _
    <OutAttribute> pcActual As UInteger() _
) As Integer
'Utilisation
Dim instance As IVsSolutionBuildManager
Dim pHier As IVsHierarchy
Dim celt As UInteger
Dim rgpHier As IVsHierarchy()
Dim pcActual As UInteger()
Dim returnValue As Integer

returnValue = instance.GetProjectDependencies(pHier, _
    celt, rgpHier, pcActual)
int GetProjectDependencies(
    IVsHierarchy pHier,
    uint celt,
    IVsHierarchy[] rgpHier,
    uint[] pcActual
)
int GetProjectDependencies(
    [InAttribute] IVsHierarchy^ pHier, 
    [InAttribute] unsigned int celt, 
    [OutAttribute] array<IVsHierarchy^>^ rgpHier, 
    [OutAttribute] array<unsigned int>^ pcActual
)
abstract GetProjectDependencies : 
        pHier:IVsHierarchy * 
        celt:uint32 * 
        rgpHier:IVsHierarchy[] byref * 
        pcActual:uint32[] byref -> int 
function GetProjectDependencies(
    pHier : IVsHierarchy, 
    celt : uint, 
    rgpHier : IVsHierarchy[], 
    pcActual : uint[]
) : int

Parameters

  • pcActual
    Type: array<System.UInt32[]
    [out, optional] Pointer to the number of projects.

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 vsshell.idl:

HRESULT IVsSolutionBuildManager::GetProjectDependencies(
   [in] IVsHierarchy *pHier,
   [in] ULONG celt,
   [in, out, size_is(celt)] IVsHierarchy *rgpHier[],
   [out, optional] ULONG *pcActual
);

Returns a list of projects that the given hierarchy depends on.

You should call CalculateProjectDependencies prior to calling GetProjectDependencies if you are unsure if the dependencies are up to date at the point of the call. CalculateProjectDependencies will force project dependencies to be recalculated.

This method should be called twice, the first time with celt = 0 and rgpHier = nulla null reference (Nothing in Visual Basic), to get the size in pcActual, then a second time after allocating the list to get the projects.

The method will be implemented as follows (error checks are omitted):

ULONG ulActual;

hr = pIVsSolutionBuildManager->GetProjectDependencies(pHier, 0, NULL, &ulActual)

// allocate memory to hold the hierarchy pointers

IVsHierarchy** rgpIVsHierarchy = (IVsHierarchy**) ::CoTaskMemAlloc(ulActual * sizeof(IVsHierarchy *));

memset(rgpIVsHierarchy, 0, sizeof(IVsHierarchy*)*ulActual);

// now get the hierarchy pointers

ULONG ulActual2;

hr = pIVsSolutionBuildManager->GetProjectDependencies(pHier, ulActual, rgpIVsHierarchy, &ulActual2);

// use the pointers here

// release the hier pointers

// release the memory

::CoTaskMemFree(rgpIVsHierarchy);

.NET Framework Security

See Also

Reference

IVsSolutionBuildManager Interface

IVsSolutionBuildManager Members

Microsoft.VisualStudio.Shell.Interop Namespace