IVsSolutionBuildManager.GetProjectDependencies Yöntem

Tanım

Verilen hiyerarşinin bağımlı olduğu projelerin listesini döndürür.

int GetProjectDependencies(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & pHier, unsigned int celt, std::Array <Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const &> const & rgpHier, std::Array <unsigned int> const & pcActual);
public int GetProjectDependencies (Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pHier, uint celt, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy[] rgpHier, uint[] pcActual);
abstract member GetProjectDependencies : Microsoft.VisualStudio.Shell.Interop.IVsHierarchy * uint32 * Microsoft.VisualStudio.Shell.Interop.IVsHierarchy[] * uint32[] -> int
Public Function GetProjectDependencies (pHier As IVsHierarchy, celt As UInteger, rgpHier As IVsHierarchy(), Optional pcActual As UInteger()) As Integer

Parametreler

pHier
IVsHierarchy

'ndaki Bir nesne işaretçisi IVsHierarchy .

celt
UInt32

'ndaki Belirtir celt .

rgpHier
IVsHierarchy[]

[in, out] Derlenecek projeleri belirtir.

pcActual
UInt32[]

[Out, isteğe bağlı] Proje sayısına yönelik işaretçi.

Döndürülenler

Int32

Yöntem başarılı olursa, döndürür S_OK . Başarısız olursa, bir hata kodu döndürür.

Açıklamalar

COM Imzası

Vsshell. IDL dosyasından:

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

Verilen hiyerarşinin bağımlı olduğu projelerin listesini döndürür.

CalculateProjectDependencies GetProjectDependencies Çağrı noktasında bağımlılıkların güncel olup olmadığını bilmiyorsanız, çağrısından önce ' i çağırmanız gerekir. CalculateProjectDependencies Proje bağımlılıklarını yeniden hesaplanacak şekilde zorlar.

Bu yöntem iki kez çağrılmalıdır, ilk kez celt = 0 ve rgpHier = null , içindeki boyutu almak için, bu durumda pcActual projeleri almak için listeyi ayırdıktan sonra ikinci bir kez çağrılmalıdır.

Yöntemi aşağıdaki şekilde uygulanır (hata denetimleri atlanır):

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);

Şunlara uygulanır