读书人

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

发布时间: 2012-03-02 14:40:29 作者: rapoo

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字符串。

读书人网 >WinCE

热点推荐