Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a automated the creation of vc++ project for a project of mine in vs2005.
But i want to change certain configurations at runtime
I want to know whether it is possible using any command line switches
Posted
Comments
Maximilien 6-Sep-11 13:08pm    
(Just asking)
Do you create projects and change configurations that often that you need automation ?
Philippe Mori 6-Sep-11 20:34pm    
You question is not clear... By "At run-time" do you mean when your automated creation is executed of when the final application is executed.

If you have already automated that... then you should be able to vary what is generated without much trouble....

On the other hand, if you generate one application, you have one application with the setting that were used. The only way to have different setting would be to build a second application.

Thus in all case, I cannot make sense of this question.

1 solution

You can change any project configuration parameters during run-time… of Visual Studio. As everyone does that anyway, this is hardly what you are trying to ask about. Probably, you want to ask about you application runtime. And this sounds like an absurd. If you knew what a build does you would not ask about it. It looks like you need to learn the very basics of compile time, run-time, application, assembly, executable module and process. No, it is not just impossible; the whole idea makes no sense.

Now, project configuration is actually translated into command line switches of the compiler directly, or MSBuild which translate all kind of configuration options into command line switches of the compiler. But this is a compiler, not your application. After your application is build, none of these options changes.

Your application can have (and usually should have) some command line parameters. With .NET (C++/CLI or not, does not matter), you can use my library (see my article Enumeration-based Command Line Utility[^]) or one more library I recommend in my article. This way, you can implement different or optional behavior depending on command line parameters. It won't have anything to do with build configurations and their parameters — just forget the idea.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900