A step-by-step debugger in C++ win32 projects in visual studio - c++

When I would work on C++ Win32 console applications I would use of F11 for step into and F10 for step over in debugger (DEBUG tab of visual studio, say 2012). But now there function keys don't work as they should in C++ win32 projects. Is there any else method for following code lines in practice in win32 projects like the work that F10 and F11 would do in win32 console applications?

There are buttons for such kind of things in th IDE and it seems really strange that the function keys should not work any longer....

You could also check the settings in Tools -> Options -> Environment -> Keyboard.

Related

VIsual Studio: Avoid console from popping up and integrate it into IDE instead

In Visual Studio when I run a program, the console pops up as a separate window. Many other IDEs, such as CLion or Eclipse integrate that console in the IDE. Is there a way to do this in Visual Studio as well? I feel this is a very basic requirement but I cannot find any such functionality.
No not really, tough why would you need it like that? If you are making an app with some graphical library and you down want it to show up you can disable it in the project options.

How to display Visual Studio Console Application output inside the IDE and not in command prompt?

I recently started C++ programming on Visual Studio and I noticed that it always gives me the console output in the command prompt (CMD).
I am a java programmer and I'm used to working with Eclipse and Netbeans. With those IDEs, I was able to see the console inside the IDE and not in a different separate window.
Is there a way to display the console output inside Visual Studio, like Eclipse and Netbeans do?
It's infuriating. I spent hours looking for this. Visual Studio doesn't have command prompt inside the IDE.
They have it for Visual Studio code - Intergrated command prompt. But not for visual studio 2015 Enterprise. So, in other words, microsoft has command prompt terminal inside the free version of visual studio but not for the paid version
Unfortunately, the answer seems to be no.
In Visual Studio, console applications are displayed on the command prompt and not inside Visual Studio itself. Meaning that Console.WriteLine method and similar ones write your output to the console window because your application type is Console Application.
You are able to write output to Visual Studio itself by using System.Diagnostics.Debug.WriteLine as mentioned on MSDN. That will cause the debug output to appear in the Output Window inside Visual Studio. In case you don't see that view, you can choose to show it by Debug => Windows => Output.
You should bare in mind that this is not what you asked for.
This "solution" is helpful just in case you want to debug parts of your code and don't want to open the command prompt but just see the relevant output inside the IDE.
In addition, you won't be able to give input back in this output view.
The most important thing, you will not be able to execute your application correctly outside of your coding environment. So, it will work only on the IDE but you won't be able to see this output when the application is on its own (as it meant to be as a console application).
Another solution, that you might like, is to work with Eclipse.
You said that you are familiar with Eclipse as a Java developer and now you work with C++ and don't get along with Visual Studio so far.
So, you can download Eclipse IDE for C/C++ Developers.
In there you will be familiar with the IDE and you will be able to display your output inside Eclipse without any weird and unnecessary workarounds.

Find out Current Directory during Visual Studio C++ Debug session

I'm debugging C++ native application on Visual Studio 2015.
After stopping on a breakpoint, I would like to know the Current Directory. (It could have changed during the execution before stopping on that breakpoint).
On .NET debugging it is possible through the immediate window. This does not work when debugging C++ native application.
Is there a way I could find out the Current Directory when debugging C++ native application?
To make it clear - I don't want to change and build my code again. I would like to find this out in the debugger (watch window, command/immediate window etc.)
In Visual Studio 2015 there is a "C# Interactive" Window.
You can use the C# command from .NET solution you presented to get the current directory while debugging Native project.
View -> Other Windows -> C# Interactive
If you don't see this option you might want to reinstall VS2015 with C#/.NET components. (I have selected all C# related components during the install.)

Visual Studio 2012 everything out of date

In Visual Studio 2012, I usually use C# applications, which work fine. Now that I feel like I have a strong grasp of C#, I've decided to move on to C++. I have changed no preferences. All of my C++ projects say that the project is out of date. Here are my steps:
File -> New Project
Click "Visual C++" tab -> Win32 Console Application
Change nothing and click OK
Click Finish for the Win32 Application Wizard
Press F5 to run, or click the button (which says "Local Windows Debugger").
I'm not sure if I'm making a mistake or if there are missing dependencies. My question is, what is causing this and how can I prevent this message? If you don't know, then what are some things that I can do to find out?
what is causing this
=> Two possible reasons :
you just created the project and have not built it before trying to launch it
OR you made some changes to the project files and tried to launch the application before building the project
how can I prevent this message?
Tick "Do not show this dialog again" and click yes : your application will automatically be built every time you want to launch it.
OR always build the project before launching it

How do I create a native application using Visual C++ 2008?

I am getting started in C++. How can I setup Visual Studio 2008 to create native (not managed) code?
Choose a Win32 Project.
If you're just getting started you probably want a Win32 Console Application, and not a Win32 App. File -> New -> Project -> Visual C++ -> Win32 -> Win32 Console Application
When you create the project itself you'll probably want to click Next before you click Finish, and select Empty Project so that VS won't add a bunch of junk to your project for you.
File -> New -> project (maybe go to other lang if you see c#) -> visuall c++ -> win32
You can choose other types there it still be native.
(like mfc, but I doubt if you really need something other then the basic win32)
In the new projects dialog, choose any project type under the Visual C++ group. You'll need Visual Studio Pro, or Visual Studio Express for C++.