Click to See Complete Forum and Search --> : How does DocView architecture handles commandline params?


Gladywin Yap
April 12th, 1999, 05:24 AM
Hi all,
1. How does an application generated by AppWizard handles command-line parameters? What are the steps being taken internally? I understand that ParseCommandLine(cmdInfo); is called to parse the command-line, and then the ProcessShellCommand(cmdInfo); is called to process the following shell commands:

app ------------------------------------------ New file.
app filename -------------------------------- Open file.
app /p filename ----------------------------- Print file to default printer.
app /pt filename printer driver port ------- Print file to the specified printer.
app /dde ------------------------------------ Start up and await DDE command.
app /Automation --------------------------- Start up as an OLE automation server.
app /Embedding --------------------------- Start up to edit an embedded OLE item.


2. My problem now is that I need to handle other command-line switches, such as, "app -c" , "app /c", or "app filename1 filename2 -d", etc. How and where do I handle all these in an application generated by AppWizard?

3. Thanks in advance for any help rendered.




Gladywin Yap
120499

Franky Braem
April 12th, 1999, 08:09 AM
You have to derive a new class from CCommandLineInfo to handle your own flags and parameters. Override ParseParam to handle the new flags.

Mike Wild
April 12th, 1999, 09:04 AM
If you need a sample, I'll send you one via E-Mail.

Mike