没错,我这的确是用了UNICODE, 在VS2005平台下,另外 playlst 定义是这样的vector<wstring> playlst; 谢谢回复,但我强制类型转换成 InsertItemListView(g_hWndList, (TCHAR *)playlst[i].c_str()); 还是通不过,有一个错误,不过,我还真找不到在哪里,我贴出来,大家帮忙找到,好吧!------ 已启动生成: 项目: DXPlayer, 配置: Debug Win32 ------ 正在编译... DXGraph.cpp c:\dxsdk\include\uuids.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(535) : warning C4996: 'wcscpy' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy' Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(537) : warning C4996: 'wcscpy' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy' Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(539) : warning C4996: 'wcscpy' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy' Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(541) : warning C4996: 'wcscpy' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy' Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(543) : warning C4996: 'wcscpy' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy' Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(545) : warning C4996: 'wcscpy' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy' Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(547) : warning C4996: 'wcscpy' was declared deprecated c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
((unsigned short *)playlst[i]).c_str();
明明是TCHAR*参数,却弄个unsigned short *
估计这里用了Unicode,TCHAR即是WCHAR,等价于unsigned short
不过估计这个playlst[i]是个string对象,
应该根据编码选择用wstring还是string,不能强制转换改为(TCHAR *)playlst[i].c_str()
编译会通过
不过运行可能会出错
没错,我这的确是用了UNICODE, 在VS2005平台下,另外 playlst 定义是这样的vector<wstring> playlst;
谢谢回复,但我强制类型转换成 InsertItemListView(g_hWndList, (TCHAR *)playlst[i].c_str()); 还是通不过,有一个错误,不过,我还真找不到在哪里,我贴出来,大家帮忙找到,好吧!------ 已启动生成: 项目: DXPlayer, 配置: Debug Win32 ------
正在编译...
DXGraph.cpp
c:\dxsdk\include\uuids.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(535) : warning C4996: 'wcscpy' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(537) : warning C4996: 'wcscpy' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(539) : warning C4996: 'wcscpy' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(541) : warning C4996: 'wcscpy' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(543) : warning C4996: 'wcscpy' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(545) : warning C4996: 'wcscpy' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
Message: 'This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\documents and settings\administrator\桌面\codefans.net\基于dx实现的播放器\dxplayer\dxgraph.cpp(547) : warning C4996: 'wcscpy' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\string.h(250) : see declaration of 'wcscpy'
报什么错?
但也不应该写成unsigned short *啊