char* 装换CString 在Debug没错,直接运行出错。
CString CJourneyManager::GetStreetDataName(int index)
{
CString name ;
name = rpOutPut.pstRouteSegList[index].pcName; //后者为char*
if(name.IsEmpty())
{
name.Format(_T("无名小路"));
}
else
{
name.GetBuffer( rpOutPut.pstRouteSegList[index].ulLength);
}
return name;
}
//函数是会循环调用的。index在0-4没错 ,5就有错。6以后又没错。觉得是数据的问题,但为什么在Debug下面index=5时也不会出错,直接运行就会报错呢。