共用方式為


IVsSolution.GetProjectFilesInSolution Method

Definition

Compiles a list of the specified projects in the solution.

public:
 int GetProjectFilesInSolution(System::UInt32 grfGetOpts, System::UInt32 cProjects, cli::array <System::String ^> ^ rgbstrProjectNames, [Runtime::InteropServices::Out] System::UInt32 % pcProjectsFetched);
int GetProjectFilesInSolution(unsigned int grfGetOpts, unsigned int cProjects, std::Array <std::wstring const &> const & rgbstrProjectNames, [Runtime::InteropServices::Out] unsigned int & pcProjectsFetched);
public int GetProjectFilesInSolution (uint grfGetOpts, uint cProjects, string[] rgbstrProjectNames, out uint pcProjectsFetched);
abstract member GetProjectFilesInSolution : uint32 * uint32 * string[] * uint32 -> int
Public Function GetProjectFilesInSolution (grfGetOpts As UInteger, cProjects As UInteger, rgbstrProjectNames As String(), ByRef pcProjectsFetched As UInteger) As Integer

Parameters

grfGetOpts
UInt32

[in] Options for returning the array of solution projects. For a list of grfGetOpts values, see __VSGETPROJFILESFLAGS.

cProjects
UInt32

[in] Number of projects in the solution, based on the option specified for the grfGetOpts parameter.

rgbstrProjectNames
String[]

[out] Pointer to array of projects within the solution.

pcProjectsFetched
UInt32

[out] Pointer to the number of project names placed in the array.

Returns

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==null to obtain the number of BSTRS required in the pcProjectsFetched parameter. Use this information to dimension an array of the appropriate size.

Applies to