Compartir a través de


IVsProject4.GetFilesEndingWith(String, UInt32, UInt32[], UInt32) Method

Definition

Returns an array of ITEMIDs of the files whose name ends with the specified string. The match is case-insensitive.

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

Parameters

pszEndingWith
String

The ending

celt
UInt32

The (requested) number of items in the array.

rgItemids
UInt32[]

The array of ITEMIDs.

pcActual
UInt32

The actual number of items returned in the array.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Examples

An extremely common pattern is to call the method twice, the first time passing in 0 for the number of items and NULL for the array, and the second time passing in a properly-sized array and the actual number of items, and like the following (omitting error checks for readability):

hr = pIVsProject4->GetFilesEndingWith(szEndingWith, 0, NULL, &cExpected);  
VSITEMID *rgItemids = ::CoTaskMemAlloc(cExpected * sizeof(VSITEMID));  
hr = pIVsProject4->GetFilesEndingWith(szEndingWith, cExpected, rgItemids, &cActual);  

Remarks

If celt is zero and rgItemids is NULL, the number of matching files is returned in pcActual. If celt is not zero, rgItemids must not be NULL, or E_POINTER is returned.

Applies to