Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-07-13 11:10:22


zh wrote:

> Greetings.

> po::options_description hidden("Hidden options");
> hidden.add_options()
> ("opt4", po::value<string>(), "opt4")
> ;
......
> po::variables_map vm;
> po::store(po::command_line_parser(argc,
> argv).options(all_options).positional(pos).run(), vm);
> po::notify(vm);
>
> Now I want to replace char* argv[] with wchar_t* in order to pass a
> Unicode file name to a Win32 SDK function CreateFile(). What would be,
> in your opinion, an appropriate course of action? I thank you in advance.

1. Replace

        char* argv[]

with

        wchar_t *arv[].

(And modify whatever IDE/compiler settings are necessary to enable wchar_t main).

2. Use 'wstring' as the type of your options, not 'string'.

Then, everything is supposed to work.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net