以前在转换ANSI到Unicode的时候很麻烦
今天看到Jefrry大牛的书看到了他的一种转化方式如下
pszLibFile(ANSI) pszLibFileW(Unicode)
SIZE_T cchSize=lstrlenA(pszLibFile)+1;
PWSTR pszLibFileW=(PWSTR)_alloca(cchSize*sizeof(wchar_t));
//Convert the ANSI pathname to its Unicode equivallent
StringCcPrinffW(pszLibFileW,cchSize,L"%S",pszLibFile);
其中有点不明白地方,就是lstrlenA(pszLibFile)为什么要+1呢?谁知道留个言啊 ,谢!
本文解释了在编程中将ANSI路径转换为Unicode路径的常见问题,特别关注了为何在进行转换时需要加1的原因,并提供了具体的实现代码。
416

被折叠的 条评论
为什么被折叠?



