Re: 回复: [cpp] 怎样转换一个ASIC字符串到宽字符形式?

analyst qiaojie at gmail.com
Thu Jun 8 21:47:36 CST 2006


用ATL的CStringT类转换是最方便的。



在06-6-8,sunpluto <sunpluto2004 at yahoo.com.cn> 写道:
>
>  第一个 MultiByteToWideChar 是用来获取UNICODE字串的字符长度
> 第二个 MultiByteToWideChar 是用来实际进行字符转换
>
> 不过,为了方便,我一般用
>
> void func( LPSTR lpsz )
> {
>    USES_CONVERSION;
>    ...
>    LPWSTR x = A2W(lpsz)
>    // Do something with x
>    ...
> }
>
> 你可以参考 MSDN 的详细说明。
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codingnow.com/pipermail/cpp/attachments/20060608/c20dadb0/attachment-0001.html


More information about the Cpp mailing list