当前位置: 代码迷 >> WinCE >> evc怎么将指针和字符串进行转换?多谢啦
  详细解决方案

evc怎么将指针和字符串进行转换?多谢啦

热度:81   发布时间:2016-04-28 13:32:35.0
evc如何将指针和字符串进行转换?谢谢啦
问题是这样的

TCITEM     tci;
tci.mask=TCIF_TEXT;
tci.pszText   =   "当天 ";
m_Tab.InsertItem(0,&tci);
tci.pszText= "最近 ";
m_Tab.InsertItem(1,&tci);
        tci.pszText= "未来 ";
m_Tab.InsertItem(2,&tci);

报错:error   C2440:   '= '   :   cannot   convert   from   'char   [15] '   to   'unsigned   short   *

------解决方案--------------------
加上_T( " ")就行了,例如

tci.pszText = _T( "当天 ");

主要原因是因为wince使用的是unicode字符串。
  相关解决方案