AliR.
Here's a function I wrote that takes the locale into consideration. You
do have to make sure the buffer is as big as nSize)
e.g.,
TCHAR buf[30];
m_cTrackList.SetItemText(nItem,2,Comma(track.startBlock, buf, 29));
PTCHAR Comma(LONGLONG value,PTCHAR bufout, UINT nSize)
{
TCHAR bufin[30]; // 30 digits is a really big number
TCHAR dsep[5], tsep[5];
NUMBERFMT fmt;
fmt.NumDigits = 0;
::GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_ILZERO,bufin,2);
fmt.LeadingZero = _ttoi(bufin);
fmt.Grouping = 3;
::GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_SDECIMAL,dsep,4);
fmt.lpDecimalSep = dsep;
::GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_STHOUSAND ,tsep,4);
fmt.lpThousandSep = tsep;
::GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_INEGNUMBER ,bufin,2);
fmt.NegativeOrder = _ttoi(bufin);
_stprintf_s(bufin, _T("%I64d"), value);
::GetNumberFormat(LOCALE_USER_DEFAULT, 0, bufin, &fmt, bufout, nSize);
return bufout;
}
Tom
"Charles Tam" <CharlesTam@discussions.microsoft.com> wrote in message
news:C592C496-D126-4D97-A78F-E6B36686852E@microsoft.com...
What's the correct way to retrieve the number of jpg files in a
directory?
Do I have to loop through each file, in order to count them up?