在C ++窗口菜单中显示日语,中文,越南语等 [英] Displaying Japanese, Chinese, Viatnamese, etc in C++ window menu

查看:116
本文介绍了在C ++窗口菜单中显示日语,中文,越南语等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当时正在制作一个程序,一旦按下它就可以显示不同的语言,但是当涉及到在菜单中显示LPSTR以显示日语选项时,它就不会显示日语字符.它只是显示"???".

I was making a program that could display different languages once pressed, but when it came to making the LPSTR in my menu to display the Japanese option, it wouldn't display the Japanese characters. It just displayed "???".

这是我的程序的屏幕截图:

Here is a screenshot of my program:

这是无效的代码:

我尝试过:

        AppendMenu(win32LANGUAGE,MF_STRING,NULL,"日本人");

和这个:

        wchar_t jap = "日本人"; 
        AppendMenu(win32LANGUAGE,MF_STRING,NULL,(LPSTR)jap);

我被困住了.我不知道为什么它不显示日语字符.预先感谢.

I am stuck. I don't know why it won't display the Japanese characters. Thanks in advance.

推荐答案

如果您的编译器未在AppendMenu上引发错误,则您可能尚未定义UNICODE宏,请尝试使用AppendMenuW,设置(应为wchar_t const*)到L"日本語",并且不要进行投射.

If your compiler doesn't throw an error on AppendMenu then you probably haven't defined the UNICODE macro, try using AppendMenuW, set jap (which should be a wchar_t const*) to L"日本語", and don't cast it.

这篇关于在C ++窗口菜单中显示日语,中文,越南语等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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