In 'ParseParam()', check the 'pszParam' passed. Note, that 'ParseParam()' will be called as many times as the tokens being used while launching the command line. So, if you call 'Yourapp.exe /e /o /whatever', you will see 3 calls to 'ParseParam()' each with "/e", "/o", "/whatever".
Instantiate an object of this class in 'InitInstance()' and parse it like below.
Code:
BOOL CYourApp::InitInstance()
{
// Do all the stuff you want to do, like registering document tempates etc.
CCustomCommandLineInfo oInfo;
ParseCommandLine(oInfo);
// ....
}
And then check
Code:
BOOL CYourApp::InitInstance()
{
// Do all the stuff you want to do, like registering document tempates etc.
CCustomCommandLineInfo oInfo;
ParseCommandLine(oInfo);
if(oInfo.IsExport())
{
// Do something
}
else if(oInfo.IsWhatever())
{
// Do whatever
}
// ....
}
Last edited by cilu; November 6th, 2007 at 01:07 AM.
Reason: fixed parameters
Bookmarks