IVsProject4::GetFilesEndingWith Method (String^, UInt32, array<UInt32>^, UInt32)
Returns an array of ITEMIDs of the files whose name ends with the specified string. The match is case-insensitive.
Assembly: Microsoft.VisualStudio.Shell.Interop.10.0 (in Microsoft.VisualStudio.Shell.Interop.10.0.dll)
int GetFilesEndingWith( String^ pszEndingWith, unsigned int celt, array<unsigned int>^ rgItemids, [OutAttribute] unsigned int% pcActual )
Parameters
- pszEndingWith
-
Type:
System::String^
The ending
- celt
-
Type:
System::UInt32
The (requested) number of items in the array.
- rgItemids
-
Type:
array<System::UInt32>^
The array of ITEMIDs.
- pcActual
-
Type:
System::UInt32
The actual number of items returned in the array.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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.
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);