void CDSFilters::SortInfoByExtension(CAtlList<DSFilterInfo*>& InfoList, const TCHAR* pcszExtension) { DSFilterInfo* pInfo = NULL; POSITION pos = InfoList.GetHeadPosition(); while (pos) { BOOL bMatched = FALSE; pInfo = InfoList.GetAt(pos); if (pInfo != NULL) { POSITION pos2 = pInfo->extensions.GetHeadPosition(); while (pos2) { CString& extension = pInfo->extensions.GetNext(pos2); if (extension.CompareNoCase(pcszExtension+1)) { bMatched = TRUE; break; } } if (bMatched) { InfoList.MoveToHead(pos); } } InfoList.GetNext(pos); } }