在Windows mobile 5.0下操作INI文件
2010-08-22 12:58:00 来源:WEB开发网核心提示:szBuf = (LPCWSTR)(pFileBuf + 2);else{PTCHAR pszWideChar = new TCHAR[dwLength + 1];MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pFileBuf, dwLength, pszWideChar, dwLeng
szBuf = (LPCWSTR)(pFileBuf + 2);
else
{
PTCHAR pszWideChar = new TCHAR[dwLength + 1];
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pFileBuf, dwLength, pszWideChar, dwLength);
szBuf = pszWideChar;
delete pszWideChar;
}
delete pFileBuf;
CString szTemp;
int nPos;
if (szBuf.IsEmpty())
retrun -1;
nPos = szBuf.FindOneOf(TEXT(" "));
if (nPos == -1)
{
return -1;
}
while (1)
{
szTemp = szBuf.Left(nPos);
szBuf = szBuf.Right(szBuf.GetLength() - nPos);
szBuf.TrimLeft(TEXT(" "));
szTemp.TrimLeft(TEXT(" "));
szTemp.TrimRight(TEXT(" "));
if(szTemp.IsEmpty())
break;
if (szTemp.GetAt(0) == TEXT('[') &&
szTemp.GetAt(szTemp.GetLength() - 1) == TEXT(']'))
{
iIniNum++;
}
nPos = szBuf.FindOneOf(TEXT(" "));
}
return iIniNum;
return -1;
}
更多精彩
赞助商链接