Solved

Command Arguments in Windows Forms Application

Posted on 2003-11-03
1
289 Views
Last Modified: 2008-03-03
How can I read Command Arguments in a windows forms application (VC++.Net)?
0
Comment
Question by:VPitre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

752 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