CString ext; int Which = m_pathOri.ReverseFind('.'); ext = m_pathOri.Right(m_pathOri.GetLength()-Which-1);