Partager via


IVsSolution.GetProjectFilesInSolution Method

Compiles a list of the specified projects in the solution.

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

Syntax

'Déclaration
Function GetProjectFilesInSolution ( _
    grfGetOpts As UInteger, _
    cProjects As UInteger, _
    <OutAttribute> rgbstrProjectNames As String(), _
    <OutAttribute> ByRef pcProjectsFetched As UInteger _
) As Integer
'Utilisation
Dim instance As IVsSolution
Dim grfGetOpts As UInteger
Dim cProjects As UInteger
Dim rgbstrProjectNames As String()
Dim pcProjectsFetched As UInteger
Dim returnValue As Integer

returnValue = instance.GetProjectFilesInSolution(grfGetOpts, _
    cProjects, rgbstrProjectNames, pcProjectsFetched)
int GetProjectFilesInSolution(
    uint grfGetOpts,
    uint cProjects,
    string[] rgbstrProjectNames,
    out uint pcProjectsFetched
)
int GetProjectFilesInSolution(
    [InAttribute] unsigned int grfGetOpts, 
    [InAttribute] unsigned int cProjects, 
    [OutAttribute] array<String^>^ rgbstrProjectNames, 
    [OutAttribute] unsigned int% pcProjectsFetched
)
abstract GetProjectFilesInSolution : 
        grfGetOpts:uint32 * 
        cProjects:uint32 * 
        rgbstrProjectNames:string[] byref * 
        pcProjectsFetched:uint32 byref -> int 
function GetProjectFilesInSolution(
    grfGetOpts : uint, 
    cProjects : uint, 
    rgbstrProjectNames : String[], 
    pcProjectsFetched : uint
) : int

Parameters

  • cProjects
    Type: System.UInt32
    [in] Number of projects in the solution, based on the option specified for the grfGetOpts parameter.
  • rgbstrProjectNames
    Type: array<System.String[]
    [out] Pointer to array of projects within the solution.
  • pcProjectsFetched
    Type: System.UInt32%
    [out] Pointer to the number of project names placed in the array.

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 IVsSolution::GetProjectFilesInSolution(
   [in] VSGETPROJFILESFLAGS grfGetOpts,
   [in] ULONG cProjects,
   [out, size_is(cProjects), length_is(*pcProjectsFetched)] BSTR *rgbstrProjectNames,
   [out] ULONG *pcProjectsFetched
);

This method obtains the full paths of the projects in the solution and is useful for pre-load knowledge about projects. The project paths are returned in an array of BSTRs—the number of BSTRS in the array is returned in the pcProjectsFetched parameter. Pass in cProjects==0 and rgbstrProjectNames==nulla null reference (Nothing in Visual Basic) to obtain the number of BSTRS required in the pcProjectsFetched parameter. Use this information to dimension an array of the appropriate size.

.NET Framework Security

See Also

Reference

IVsSolution Interface

IVsSolution Members

Microsoft.VisualStudio.Shell.Interop Namespace