CCommandLineInfo's ParseParam not getting called

O

otengo

Hi,
I've followed simple steps ie: Created a class (call it mycommandline)
inheriting from CCommandLineInfo. Than overrided the ParseParam
method. Created a mycommandline object and passed to ParseCommandLine
method of my CWinApp inside its InitInstance method. Now I pass
command line arguments to my application but my overrided ParseParam
is not getting called. What am I doing wrong?

command line class code that I wrote is:
class mycommandline: public CCommandLineInfo
{
public:
mycommandline();
virtual void ParseParam(const char* pszParam, BOOL bFlag, BOOL
bLast );
};
mycommandline::mycommandline()
{}
void mycommandline::parseParam(const char* pszParam, BOOL bFlag, BOOL
bLast )
{
::MessageBoxA(NULL, pszParam, "args", MB_OK);

}

Regards,

...ab
 
B

Ben Voigt [C++ MVP]

Hi,
I've followed simple steps ie: Created a class (call it mycommandline)
inheriting from CCommandLineInfo. Than overrided the ParseParam
method. Created a mycommandline object and passed to ParseCommandLine
method of my CWinApp inside its InitInstance method. Now I pass
command line arguments to my application but my overrided ParseParam
is not getting called. What am I doing wrong?

command line class code that I wrote is:
class mycommandline: public CCommandLineInfo
{
public:
mycommandline();
virtual void ParseParam(const char* pszParam, BOOL bFlag, BOOL
bLast );

With VC++ 2005, you can put "override" on the end of that line, same place
const would go, and the compiler will tell you if it would shadow instead of
overriding. This was added for .NET, but works in native (like MFC)
programs as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top