WinMain和wWinMain之间的区别 [英] Difference between WinMain and wWinMain

查看:138
本文介绍了WinMain和wWinMain之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

唯一的区别是Winmain接受char *作为lpCmdLine参数,而wWinMain接受wchar_t *.

The only difference is that Winmain takes char* for lpCmdLine parameter, while wWinMain takes wchar_t*.

在Windows XP上,如果应用程序条目是WinMain,Windows是否会将命令行从Unicode转换为Ansi并传递给应用程序?

On Windows XP, if an application entry is WinMain, does Windows convert the command line from Unicode to Ansi and pass to the application?

如果命令行参数必须使用Unicode(例如Unicode文件名,转换将导致某些字符丢失),这是否意味着我必须使用wWinMain作为输入函数?

If the command line parameter must be in Unicode (for example, Unicode file name, conversion will cause some characters missing), does that mean that I must use wWinMain as the entry function?

推荐答案

在Windows XP上,如果应用程序条目是WinMain,Windows是否会将命令行从Unicode转换为Ansi并传递给应用程序?

On Windows XP, if an application entry is WinMain, does Windows convert the command line from Unicode to Ansi and pass to the application?

是的

如果命令行参数必须使用Unicode(例如Unicode文件名,转换将导致某些字符丢失),这是否意味着我必须使用wWinMain作为输入函数?

If the command line parameter must be in Unicode (for example, Unicode file name, conversion will cause some characters missing), does that mean that I must use wWinMain as the entry function?

是的,如果要正确处理程序的Unicode参数,则应该这样做.

Yes, you should, if you want to correctly handle Unicode arguments to your program.

MSDN上 WinMain()的文档也同意.

The documentation to WinMain() on MSDN also agrees.

但是,您也可以使用GetCommandLineW来检索Unicode格式的命令行.

You can, however, also use GetCommandLineW to retrieve the command line specifically in Unicode.

这篇关于WinMain和wWinMain之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆