Reputation: 1279
I'm fairly new to visual studio /c++ and was given a project with a large number of dialogs, popups etc. When debugging I would like to know which dialog is loaded onto the screen. Is there a way to find that out in visual studio?
Thanks.
Edit - I cannot set a break point since I don't know where the code which executes a dialog is located at (as the code base is pretty large it's hard to locate). What I would like is when a dialog appears to know it's name, i.e - IDC_DIALOG_NAME ect..
Upvotes: 0
Views: 70
Reputation: 4590
This is really simplistic, but, when a dialog appears, it typically has a caption. You can easily search the resource file for the caption and it should indicate the dialog resource (eg. ID) that owns it. From there, you can search the code base for the definition of the dialog resource. This should lead you to the correct dialog class.
Upvotes: 3
Reputation:
Not sure how familiar you are with debugging, so I'll explain it as if you're new to it in general. You're going to want to set some breakpoints first. You can do this by right clicking on the line of the place you want to put your breakpoint, the breakpoint>Insert breakpoint.
A breakpoint will pause a program at that line in your code once you compile it. Once it's paused, you can look at a lot of information about what data your program is currently holding. To do this, press alt+4 to pull up the local variables window. This window shows you all the current values of your local variables at the point of the pause. If you want to follow a variable, you can right click it, and select "watch". This is isolate the variable in it's own tab, and as you step between break points, you can follow it's value more easily.
So if you were to watch the value of whatever class or function is outputting the dialog, this would be a good way to do it.
http://msdn.microsoft.com/en-us/library/vstudio/y740d9d3(v=vs.90).aspx THis page might offer you some additional help!
Upvotes: 2