Solved

Want help on command line parameters

Posted on 2004-04-13
5
292 Views
Last Modified: 2010-04-01
Hi,
I am pretty much new to VC++. I am actually working on getting command line parameters to VC++ app. I have pasted my code into it:
int WINAPI WinMain(HINSTANCE hInstance,
                           HINSTANCE hPrevInstance,
                           LPSTR lpCmdLine,
                           int nCmdShow)
{
char* str2 = lpCmdLine;
//This actually gets only the first argument from the arguments list.
}
Eg: C:\>Hello.exe Test this out
I get only Test in the output.

Could somebody tellme how to get the command line parameters into this code.


Thanks in advance,
Pampa
0
Comment
Question by:pampa34
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Sys_Prog
ID: 10820035
0
 
LVL 10

Accepted Solution

by:
Sys_Prog earned 125 total points
ID: 10820059
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

860 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