gpt4 book ai didi

c++ - WinMain 和 wWinMain 的区别

转载 作者:IT老高 更新时间:2023-10-28 21:57:56 27 4
gpt4 key购买 nike

唯一的区别是 Winmain 使用 char* 作为 lpCmdLine 参数,而 wWinMain 使用 wchar_t*。

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

如果命令行参数必须是Unicode(比如Unicode文件名,转换会导致一些字符丢失),是不是说我必须使用wWinMain作为入口函数?

最佳答案

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

是的。

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 参数,您应该这样做。

文档发送至 WinMain() on MSDN也同意。

不过,您也可以使用 GetCommandLineW 专门以 Unicode 检索命令行。

关于c++ - WinMain 和 wWinMain 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1792275/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com