command line arguments?
command line arguments?
i'm using wxSmith (Code::Blocks) for development. I want to get the command line arguments on beggining of my program, but I can't find main function anywhere, ony OnInit which is located in the ....App.cpp.
Re: command line arguments?
wxApp has argc/argv as members.
http://docs.wxwidgets.org/trunk/classwx ... 31a5e8bfc5
http://docs.wxwidgets.org/trunk/classwx ... 31a5e8bfc5
Use the source, Luke!
Re: command line arguments?
Code: Select all
wxApp xarg;
if (xarg.argc == 2) {
if (xarg.argv.GetArguments().Item(1) == "fopen") {
dlgIntro.ntbMain->SetSelection(1);
}
}
Nothing happens
Re: command line arguments?
You can't just create a new wxApp instance. Remember that the starting point of your wxWidgets application is OnInit() from your wxApp derived class? That's where you can access the argc/argv members.
Use the source, Luke!
Re: command line arguments?
thanks, i realised that just after. i was trying to make it to get WXAPP.argc, but then i saw that the function is actually in a class function WXAPP::OnInit, so i replaced WXAPP.argc with argc