void CChordEaseApp::LoadStringArray(LPCTSTR Section, CStringArrayEx& Arr) { int nItems = theApp.GetProfileInt(Section, _T("Count"), 0); Arr.SetSize(nItems); for (int iItem = 0; iItem < nItems; iItem++) { CString sKey; sKey.Format(_T("%d"), iItem); Arr[iItem] = theApp.GetProfileString(Section, sKey); } }
void CPartBassDlg::GetPowerOfTwoStrings(CStringArrayEx& Str, int LowerExp, int UpperExp) { int nItems = UpperExp - LowerExp + 1; Str.SetSize(nItems); for (int iItem = 0; iItem < nItems; iItem++) { int iExp = iItem + LowerExp; int shift = iExp; LPCTSTR fmt; if (iExp < 0) { fmt = _T("1/%d"); shift = -shift; } else fmt = _T("%d"); Str[iItem].Format(fmt, 1 << shift); } }