Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » about the using of unicode in win32 platform
about the using of unicode in win32 platform [message #39016] |
Thu, 07 February 2013 05:40 |
LeiMing
Messages: 21 Registered: September 2009 Location: China
|
Promising Member |
|
|
today I'm thinking about how to deal with commandline parameter,
and finding that ultimate++ currently using WinMain with LPSTR lpCmdLine parameter.
I think it's better to using unicode via wWinMain with LPWSTR lpCmdLine parameter. I change the macro a little, becoming
C:\upp\uppsrc\CtrlCore\Win32GuiA.h
#define GUI_APP_MAIN \
void GuiMainFn_();\
\
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int nCmdShow) \
{ \
UPP::Ctrl::InitWin32(hInstance); \
UPP::coreCmdLine__() = UPP::SplitCmdLine__(UPP::ToUtf8(lpCmdLine)); \
UPP::AppInitEnvironment__(); \
UPP::AppExecute__(GuiMainFn_); \
UPP::Ctrl::CloseTopCtrls(); \
UPP::Ctrl::ExitWin32(); \
UPP::AppExit__(); \
return UPP::GetExitCode(); \
} \
\
void GuiMainFn_()
It works fine for me.
Do you consider about this? I think it's a improvement in internalization.
by the way, is there any official way to get access to argument of execute commandline? I don't know if coreCmdLine__ is the interface for library user.
regards,
LeiMing
[Updated on: Thu, 07 February 2013 05:45] Report message to a moderator
|
|
|
Re: about the using of unicode in win32 platform [message #39017 is a reply to message #39016] |
Thu, 07 February 2013 07:09 |
|
LeiMing wrote on Thu, 07 February 2013 05:40 | by the way, is there any official way to get access to argument of execute commandline? I don't know if coreCmdLine__ is the interface for library user.
|
There is CommandLine() function, which returns Vector containing the command line arguments, stripped of the zeroth argument (the executable name, which has its own method GetExeTitle()). Also this method is aware of charset, so probably the utf8 should be handled in there rather than in wWinMain.
Best regards,
Honza
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 19 13:36:22 CEST 2024
Total time taken to generate the page: 0.03674 seconds
|