Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Bug?: Command line arguments passing problem (Windows)
Bug?: Command line arguments passing problem (Windows) [message #24770] Fri, 29 January 2010 15:10 Go to next message
kov_serg is currently offline  kov_serg
Messages: 37
Registered: August 2008
Location: Russia
Member
Upp-1824-Win32

When I pass program paths with russian letters (cp1251) program have very strange strings from CommandLine()

Windows passign arguments in cp1251 not utf8. So if I pass arguments from IDE Debug/Run options/programm argumetns. It works.
But when I drag and drop file on my exe. Windows send command line in 1251. So program could not find files.

In CtrlCore/CtrlCore.h function int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int nCmdShow)
has different behaviour for WINCE and !WINCE
	...
1735	#ifdef PLATFORM_WIN32
	...
1740	#ifdef PLATFORM_WINCE
	...
1745	int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpCmdLine, int nCmdShow) \
	...
1748		UPP::coreCmdLine__() = UPP::SplitCmdLine__(UPP::FromSystemCharset(lpCmdLine)); \
	...
1761	#else
	...
1763	#define GUI_APP_MAIN \
	...
1766	int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow) \
	...
1769		UPP::coreCmdLine__() = UPP::SplitCmdLine__(lpCmdLine); \
	...


Why line 1748 differ from 1769 ?
If I change line 1769 adding FromSystemCharset it works fine in windows.

Is it bug or feature?
Re: Bug?: Command line arguments passing problem (Windows) [message #24781 is a reply to message #24770] Fri, 29 January 2010 19:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Patch applied...
Re: Bug?: Command line arguments passing problem (Windows) [message #24784 is a reply to message #24781] Fri, 29 January 2010 20:05 Go to previous messageGo to next message
kov_serg is currently offline  kov_serg
Messages: 37
Registered: August 2008
Location: Russia
Member
And how about command line:

uppsrc\ide\Debug.cpp
...
80:		cmdline << runarg;
...


Should it be converted from utf into os code page?
Re: Bug?: Command line arguments passing problem (Windows) [message #24794 is a reply to message #24784] Sat, 30 January 2010 10:47 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes. Patch applied.
Previous Topic: Pick problems
Next Topic: Getting timezone or UTC offset?
Goto Forum:
  


Current Time: Sat Apr 27 18:17:27 CEST 2024

Total time taken to generate the page: 0.04028 seconds