argc and argv problem
Vadim Zeitlin
vadim at wxwidgets.org
Thu Apr 24 10:29:36 PDT 2008
On Thu, 24 Apr 2008 09:32:03 -0700 (PDT) Jeff Lacki <jeep at rahul.net> wrote:
JL> In my App it seems that argc and argv arent there.
JL> My app ctor:
argc and argv are not set when the application class ctor is being
executed (how could they, indeed? you need to create the object first
before modifying its fields!). To be precise they're set after
wxApp::Initialize() returns but all you really need to know in practice is
that they're available in your OnInit() -- which is normally the earliest
place where you can hook into the startup process.
JL> When I run the debugger and try to print argc,
JL> it says:
JL>
JL> No symbol "argc" in current context.
Try "p this->argc", gdb is not always smart where C++ is concerned.
JL> the argv line SEGV's for the same reason.
No, not at all. It crashes because argv is NULL, not because the debugger
can't find it.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list