cnhome的专栏

浪淘沙

VC native code应用项目字符集的选择

最近在读一段关于C++ AMP的Samples代码,代码里有这么一段

----------------------------------------

#ifndef UNICODE
#error "DXUT requires a Unicode build. See the nearby comments for details"
//
// If you are using Microsoft Visual C++ .NET, under the General tab of the project
// properties change the Character Set to 'Use Unicode Character Set'. 
//
// Windows XP and later are native Unicode so Unicode applications will perform better. 
// For Windows 98 and Windows Me support, consider using the Microsoft Layer for Unicode (MSLU). 
//
// To use MSLU, link against a set of libraries similar to this
//      /nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib /nod:version.lib /nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib /nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib UnicoWS.lib kernel32.lib advapi32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib version.lib mpr.lib rasapi32.lib winmm.lib winspool.lib vfw32.lib secur32.lib oleacc.lib oledlg.lib sensapi.lib dxerr.lib dxguid.lib d3dx9d.lib d3d9.lib comctl32.lib
// and put the unicows.dll (available for download from msdn.microsoft.com) in the exe's folder.
//
// For more details see the MSDN article titled:
// "MSLU: Develop Unicode Applications for Windows 9x Platforms with the Microsoft Layer for Unicode"
// at http://msdn.microsoft.com/msdnmag/issues/01/10/MSLU/default.aspx
//
#endif

-------------------------------------------

在开发VC native code的时候为了保持在Windows环境下的效率还是需要使用微软的Unicode字符集模式效率更高些。看到很多从VC6上来的程序员经常还是使用asc字符集,经常是不得其解。此处算是一个印证。

 

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cnhome/article/details/6877279
个人分类: VC
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭