C++拆分文件路径或特定分隔符的长字符串

CArray<CString, CString> strArray;    strArray.RemoveAll();
if (0 == _strcmpi("", sFilePath))
{
        AfxMessageBox("文件路径为空");
        return;
}
int iIndex = 0;  
while (1)  
{  
        iIndex = sFilePath.Find("\\");  
        if(iIndex >= 0)  
        {  
                strArray.Add(sFilePath.Left(iIndex));  
                sFilePath = sFilePath.Right(sFilePath.GetLength()-iIndex-1);  
        }  
        else  
        {  
                break;  
        }  
}  
strArray.Add(sFilePath);