Command Line Arguments in Unicode
What is the best method to access the command line arguments in a single source Unicode/ASCII program?
I use __argc and __argv[] to access command line arguments from within MSVC++, however this does not work for strings defined as TCHAR for compliance with Unicode. Is GetCommandLine() and CommandLineToArgvW() the way to go?
Re: Command Line Arguments in Unicode
Quote:
Originally posted by JasonD
I use __argc and __argv[] to access command line arguments from within MSVC++
You can continue to do so if you wish: __targv is defined in tchar.h as either __argv or __wargv(_UNICODE).
You just have to use _tWinMain as in Fordy's example - or just parse the command line (LPTSTR lpCmdLine) from there as Fordy implied.