Reputation: 371
I am new to C programming and I'm currently developing a simple Win32 console application to help me learn. I'm doing this at work and they have provided me with Visual Studio 2010. Our work computers are restricted so I do not have the option to install additional software or make changes which require admin access.
While attempting to debug my program, I discovered that there are several options available. The two below are the ones I want to use:
When I pick option 1, the application is launched directly (as if I'd double clicked the .exe file). However, when I pick option 2, the application is launched indirectly via cmd.exe. Also, at the point where the application would normally terminate, a line of text comes up which says 'Press any key to continue'. That keeps the console open until I press another key.
Is there a way to to modify the settings in Visual Studio so that option 1 behaves the same as option 2 but still allows debugging? If not, are there any other workarounds which will accomplish the same thing and can be initiated with a single keyboard shortcut?
Upvotes: 1
Views: 370
Reputation: 2214
Unfortunatelly, I don't know any "out-of-the-box" (see alternative below) way to accomplish the same thing with a single keybard command but the following is what I think could be help you:
If you really need a single command to do all this I think you'll need to write your own VS macro. If you need help with such macro it is probaly needs to be a different question.
[EDIT]
You said in your question that you are with VS2010, so the following is probably not an option for you, but just in case I'll add it here:
If you were using VS2013 or (2015) you could use
Child Process Debugging Power Tool (another link), which will allow you to specify cmd $(TargetPath)
as "command" and then use your 1st option to debug cmd
together with its child process, which will happen to be your process (screenshot from VS2012, but the same option exsists in VS versions)
Upvotes: 1