Solved

Want help on command line parameters

Posted on 2004-04-13
5
290 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
Comment Utility
0
 
LVL 10

Accepted Solution

by:
Sys_Prog earned 125 total points
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now