Visual C++ 2005: How to view the window during a debugging session - c++

Is this possible? When I'm debugging a program I can't bring the window up to see any changes. It's minimized during the debugging while I step through the program and I'd like to see the program changes while I step.
The only way I might see it is in Windows 7 you can hover over the task-bar to get a look at the program but the preview image gets in the way and It's just a weird way to see my program.
I've been trying to search for this problem but all I get is irrelevant results. Maybe I'm missing a few keywords or something. I don't know what to call my problem.

Two choices:
Don't maximize the IDE window and make it smaller until you can see the program window.
Have two monitors and put the program window on the secondary monitor.

Related

Visual Studio Community 2019 C++ Console App template closes instantly

Edit:1 There have been a lot of good suggestions to help me out. The answer by Jeaninez has helped my Hello World stay on the screen instead of blinking for a microsecond.
But my initial question stands, why does Visual Studio 2019 default Hello World Console App not hold the Hello World open and instead open two windows. Here is a video with the fixed version and the one with the default template: https://www.youtube.com/watch?v=LVUsHp9K8Tw
Original Question
I'm sure this question has been asked a million times, but my issue seems to be quite different. I am using the
Console App Template which is by default a hello world, but when I Ctrl+F5 it to see how it works it blinks on the screen then shows this:
I tried putting in a return 0; and made sure my project was set to Console. The only thing that I've found that helps a tiny bit is `system("pause");
It's not closing. You know that - you took a picture of it.
It is, however, really small. And in addition VS 2019 (unlike earlier versions) adds this text about "press any key" to close the window. So you're not seeing your own output at all.
Here's what to do. Click the little icon in the title bar:
You will get a menu, choose Properties. This gets you a tabbed dialog: choose Layout. Change to a larger height and width and you'll be able to see what is going on.
When you like it, after you have finished running the app and closed the console window, close Visual Studio and re-open it. Now you'll consistently get that window size.
"system("pause");" is part of Windows API and so it won't work in other operation systems.You should try to use just objects from C++ standard library. I suggest you could try to use :
std::cin.get();
return 0;

Dockable windows are not reinstated correctly

This is my first question in this community. I always search a lot when having problems and I always find an answer. But not in this one. Maybe I am not asking Google correctly.
Anyways this looks like a bug to me but I might get it wrong.
Using VS2012 (or 2013) I create the default Multiple documents MFC application. I do not write a single line of code. I compile and run. Then as a user I dock the properties window which by default is at the right to the output window as shown below .
Then I close the application and restart. The window is where it should be but with different width as shown below
If you dock the window to the right (in the view and not in another window) then there is no problem. The position and width are restored just fine. Also this only happens if the main window is maximized. The behaviour, if the main window is not, is as expected.
Do you think it is actually how Microsoft wanted to make this work or they missed that? Is there a workaround for this?
Again forgive me if this question has been asked before but really...
I couldn't find anything.
Appreciate any kind of help.

watch window in the debug is empty

I was trying to understand how to fix my watch window but didn't find any good answer(I'm using visual studio 2013).
I used the debugger and suddenly the watch window didn't show the values or the object i'm have in the block - actually it didn't show anything anymore.
Does anyone know how can it be fixed?
Many thanks!!!
Maby this will help you:
To open the QuickWatch dialog box with a variable added While in break
mode, right-click a variable name in the source window name and choose
QuickWatch. This automatically places the variable into the QuickWatch
dialog box.
Source
The Watch windows don't show anything by default, you need to add things to them to see the values. What might have happened in your case, is that either you deleted what you had by mistake, or you ran into a bug, where something got corrupted in your solution and they were lost.
If you want to see everything that is currently in scope, the Locals window is the way to go.
And if you want a superset of that (which has both current and previous statement), use the Autos window.
The QuickWatch dialog box is similar in concept to the Watch window, but QuickWatch can display only one variable or expression at a time
https://msdn.microsoft.com/en-us/library/bhawk8xd.aspx

Get output of c++ program in fullscreen.It is a console output window targeted code

I use Windows 7 Ultimate.I set the CMD on pc to almost fullscreen(changed the properties from cmd title bar).Though taskbar is visible , it is the maximum fullscreen possible on Windows 7,I suppose.
I wrote code for a small command line user interface game.I've made a mistake by assuming the output screen to be maximized on every user's PC.
So,when I run it on another windows 7 machine,I'm getting weird output as the cmd screen is not maximized on their PC.
How can I ensure that I get the cmd screen set to fullscreen(almost fullscreen) on every PC it runs?
Can I call some functions in my code?
Or any other way?
I like to share it(the .exe file of my code) on the internet.So, how I can I fix this.
What you have to do is run the program and change the settings in that specific command window, not the default settings for your command window. You could do this with code as well, although I don't know how, but this is much easier. Then whenever that program is ran it should override the users default command settings and adhere to your program's.
Here's a similar answer of mine to another question about command colors. Same solution should work here.

Is it possible to embed a command prompt in a win32 app?

In linux and when installing packages etc. There are some installers that have a progress bar and a dos window which shows the files being extracted etc. How can i add this window to my C++ Win32 programs so that i can have it showing the tasks im doing? I cannot find any documentation on MSDN.
Question: How can i add a console window (if that's what its called, sure looks like one) in my program to show the details of the task at hand being done?
Here is a window with what i am asking.. (personal info so I erased the details. :]
You cannot embed a real console window inside another window (although a windowed process can have a separate console window). While it looks like a console window / command prompt, it is just a matter of appearances. What you want to do is create a sub-window/control with similar characteristics as a console window and then redirect the console output from the application(s) being run to append to that sub-window. For more information on how to do redirect the console output in Windows, see http://support.microsoft.com/kb/190351.
That "dos window" is a regular edit control: CreateWindow(ES_MULTILINE, EDIT, ...
However, it has the font set to a fixed-width one (Looks like courier). This is done by sending WM_SETFONT to the edit control.
#user995048 says "You cannot embed a real console window inside another window". But "cannot" is a strong word! I can run an entire virtualized computer in a window if I wish. :) So one can quite reasonably intuit that there are ways of doing what you say.
Sure, it is true that what you've seen are almost certainly cases of output redirection into a custom widget, designed to mimic the simple appearance of a terminal. However...if you want to embed one application's window inside another, there are things you can look into which might fit. Cooperative methods exist like GtkPlug, for instance:
http://developer.gnome.org/gtk/2.24/GtkPlug.html
To actually capture a not-designed-to-cooperate app's window and throw it in your app would be trickier. But possible, just as screen captures and virtual machines are possible. Probably best to avoid that sort of thing unless there's really a cause for it, though...
Try this
http://www.codeguru.com/cpp/misc/misc/article.php/c277/
link. I think the solution provided is what you need.
I tried it many years ago and it worked. I have not tried it in newer versions of windows though.