473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Command line arguments ignored

Hi,

I am developing a C++ project and want to pass some command line
arguments in VS .NET 2003. I am in debug mode, the configuration is set
to Debug and I entered my argument list in Project -> Project
Properties -> Configuration Properties -> Debugging -> Command
Arguments. The blurb provided in the properties window for this field
reads "The command line arguments to pass to the application." which
sounded promising.

However, when I hit F5 or click on Debug -> Start and in my program
check for the number of arguments, my argument list is ignored, i.e. no
arguments are passed on. Not quite the expected behaviour.

If I start my program from a command line outside VS, the arguments are
passed on correctly, so I don't think it is my program but rather that
I misunderstand the settings in the properties window. Does anyone have
an idea of what I am missing?

Regards,
Roland

Jan 12 '06 #1
4 1961
sej

Roland skrev:
Hi,

I am developing a C++ project and want to pass some command line
arguments in VS .NET 2003. I am in debug mode, the configuration is set
to Debug and I entered my argument list in Project -> Project
Properties -> Configuration Properties -> Debugging -> Command
Arguments. The blurb provided in the properties window for this field
reads "The command line arguments to pass to the application." which
sounded promising.

However, when I hit F5 or click on Debug -> Start and in my program
check for the number of arguments, my argument list is ignored, i.e. no
arguments are passed on. Not quite the expected behaviour.

If I start my program from a command line outside VS, the arguments are
passed on correctly, so I don't think it is my program but rather that
I misunderstand the settings in the properties window. Does anyone have
an idea of what I am missing?

Regards,
Roland


Hi Roland

I am using the same way of specifying parameters to my program and it
works fine both in debugging and in real life.

Does your parameters have a special format or special characters?

Svend-Erik

Jan 12 '06 #2
Hi Svend-Erik,

no, the parameters have no special format. I even simply tried integer
numbers like 123, but end up having the same problem.

What do you have in the 'Command' field? In my settings, VS puts
$(TargetPath) there. Not sure if that is what should be there.

Roland

Jan 12 '06 #3
sej
Roland

I have the same value in my 'command' field.

But notice that if you have more projects in your solution, (for
example dll libraries), then the command line parameters must be set in
the executing project (the exe file project)

Svend-Erik

Jan 12 '06 #4
Hi Svend-Erik,

thanks! That was the problem. Somehow it had set to startup a different
part of the project. I had to set it to 'Single Startup Project' and
then select the right one and it worked.

Roland

Jan 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hari | last post by:
can i have command line arguments in VS.NET applicatio? if yes how? Can i have some code snippets of the above functionality? I know we can acjieve this in console application form command...
6
by: Jon Hewer | last post by:
hi i am writing a little script and currently implementing command line arguments following the guide by mark pilgrim from dive into python; ...
2
by: SunRise | last post by:
Hi I am creating a C Program , to extract only-Printable-characters from a file ( any type of file) and display them. OS: Windows-XP Ple help me to fix the Errors & Warnings and explain...
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
1
by: Rune Jacobsen | last post by:
Hi, I've been trying to figure this one out, but my experience just doesn't have what it takes... :| I am writing an application that reads an XML file and displays the contents in various...
40
by: raphfrk | last post by:
I have a program which reads in 3 filenames from the command line prog filename1 filename2 filename3 However, it doesn't work when one of the filenames has spaces in it (due to a directory...
2
by: Milan | last post by:
Hi, Please guide me how to set command line argument and how to retrive command line argument. Senario: vb.net application should be able to execute from command prompt by passing login and...
2
by: =?Utf-8?B?UmFtb24gR2VuZQ==?= | last post by:
Hello: I am building a console application and I am having an issue with the command line arguments. A couple of my arguments are paths and they are usually enclosed in double quotes. If one of...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.