By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,916 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,916 IT Pros & Developers. It's quick & easy.

Command line arguments ignored

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.