Solved

Command Arguments in Windows Forms Application

Posted on 2003-11-03
1
288 Views
Last Modified: 2008-03-03
How can I read Command Arguments in a windows forms application (VC++.Net)?
0
Comment
Question by:VPitre
1 Comment
 
LVL 2

Accepted Solution

by:
steve_hsk earned 125 total points
ID: 9673283
Hi VPitre ...

String *arguments[]   = Environment::GetCommandLineArgs();
      
// ***** NOTE ***** The command line arguments include the path and
//                  filename as the first argurment.
      
// 1.1 Ensure that there are enough Arguments to process
if (arguments->Count < 2)
{
     // 1.2 Parse the Command Line Strings         
    if (arguments[1]->ToUpper() == "-HELP")
    {
        // 1.3 Produce the Help Screen Text to the User
        ShowHelp();
    }
}

Hope this helps :-)
STeve
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question