int pos = 0; while((pos = it->m_strFile.find(_T("%UC_INSTALL_ROOT%\\"), pos)) != it->m_strFile.npos) it->m_strFile.replace(pos, _tcslen(_T("%UC_INSTALL_ROOT%\\")), _T("") );