高手给指点一下,是不是CString的Left不好使了??
有以下代码:
int a = fileconfig.GetLength();
fileconfig.Read(temp.GetBuffer(a),a);
fileconfig.Close();
TRACE("%s\n\n",temp);
int pospath = temp.Find("|||",0);
TRACE("%d\n\n",pospath);
CString defsavepath=temp.Left(pospath);
TRACE("%s\n\n",defsavepath);
说明如下:fileconfig是CFile类的,读取了config.ini文件
config文件18字节内容是:C:\download|||5|||
TRACE后的结果是:
temp:C:\download|||5|||妄
pospath:11
defsavepath:C:\download|||5|||妄
主要问题是:为什么Left没有剪掉第一个|||之后的字符串?