Is there a way I can read the command line arguments passed into a C++ wxWidgets application? If so, could you please provide an example of how to do so.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
Have a look at these examples (1, 2) or:
You can access the command line variables from your
wxApp
as it inherites fromwxAppConsole
which provides wxAppConsole::argc and wxAppConsole::argv.In plain C++, there is
argc
andargv
. When you are building a wxWidgets application, you can access these usingwxApp::argc
,wxApp::argv[]
orwxAppConsole::argc
,wxAppConsole::argv[]
. Note thatwxApp
is derived fromwxAppConsole
, so either works depending on if you have a console app or GUI app. See wxAppConsoleYou may also be interested in wxCmdLineParser.