How to switch to the design view in VC++ 2012? - c++

I have just installed Visual Studio 2012 Professional Edition and I'm planning to write my first Hello World application but I can't find the designer view !
How can I switch to the designer mode in Visual C++ 2012 Professional?

Maybe you are used to C#, where when you have let's say MyForm.cs and you just open it, it opens MyForm.cs [Design] window by default, in which you can design your dialog.
In Visual C++, the appearance of the dialog is stored in the resource file, thus you need to double click on Win32Project3.rc which will switch your left pane to the Resource view. Then you will see more resource types (they look like folders) and under Dialog you will find your dialog.

I found that double-clicking the header file (as shown in the Solution Explorer) opens designer view where applicable. To get the actual template, I used an online template through VS2015. Sorry if this response isn't the best, I just got a hang of it earlier today...

Related

Missing View Design in Visual C++ (Visual Studio 2017)

I can't open View Design in VS 2017, it's just missing.
It doesn't show any desinger in the open methods.
Neither in the other pop-up window..
If your project is MFC project, it has a '.rc' file. Double click this file will lead you to dialog or view designer. Other wise these is NO any view design. The second picture you mentioned can only navigate you to '.cpp' file of an '.h' file.

How can I use add and drop in visual studio 2015 c++?

I would like to build an application using C++, but I am facing a problem with the GUI. is there a simple way to make a user interface just by adding and drops buttons and labels like in Java ? Some told me to use QT but I want to use visual studio. Is it possible?
Visual Studio has a Resource Editor, that allows you to drag/drop various controls from the Toolbox panel onto your dialog. You don't really need MFC support for that.
You can use an App Wizard to create new project of a Win32 type, open its .rc file, add new dialog and start experimenting.

Can't find Windows Forms Application for C++

I'm really new to visual studio and programming in general. I'm using Visual Studio Community 2015 Desktop Version (from what I know).
I can't find a Windows Forms Application from the C++ category, while there is one for C#.
Can anyone help, do I need to download another version, a plugin, or anything?
Sorry if a stupid question, I just really can't figure it out!
There are no C++ Windows Form templates in Visual Studio 2015. As I see it, you have two choices:
When creating a new project, You will see an online dropdown, click that and try to search for "C++ Windows Forms".
Create an empty C++ CLR project and add a Windows Forms to it. This link puts it like this (credit to the onContentStop, the user who posted this):
Make a "CLR Empty Project".
Press Ctrl-Shift-A and create a Windows Form (under UI).
Inside the CPP file that is created, paste this code, replacing anything in square brackets except [STAThread] with the appropriate names:
#include "[FORM NAME].h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]//leave this as is
void main(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew [PROJECT NAME]::[FORM NAME]);
}
Right click your project in the Solution Explorer and click Properties.
Under Configuration Properties > Linker > Advanced, change Entry Point to "main" (without quotation marks).
Under Configuration Properties > Linker > System, change SubSystem to "Windows (/SUBSYSTEM:WINDOWS)" (without quotation marks).
Though this has already been answered, I feel like this might help those who stumble across this in the future. While creating a new project, directly above the text field for naming your project, there is a blue link that reads "Click here to go online and find templates" If you click that link it will direct you to templates that are available for you to download & use. Simply use the hierarchy on the left hand side and navigate to Visual C++ and you should be able to simply click "C++ Windows Forms" and it will create the new project, while also downloading and installing the template for future use. So, next time you go to create a C++ Winform you wont have to search for it again.
Click File-New-Project
Click online
Click/ Expand Visual C++
Click windows form application
Click C++/CLR Windows Forms fur Visual Studio 201..
Write project Name And Click OK.
Download and enjoy!!

Attaching Documentation in Visual Studio (à la Eclipse)

I'm new to Visual Studio (2012) and having come from using Eclipse, I'm finding myself missing the ability to hover my mouse over a method and receive a dialogue detailing the parameters and any accompanying comments.
In this particular example, I'm using the OpenGL SDK with C++ in Visual Studio, and I would like to be able to quickly get at the documentation without having to jump between VS and http://www.opengl.org/sdk/docs/man/.
Is there a way that I can attach the documentation somehow so that I can view it from within Visual Studio itself without needing to manually search?
visual studio does provide the functionality you are looking for as a tooltip (instead of a dialogue) when you hover long enough (2-3 seconds). For this to work correctly and more usefully though, you'd need the functions to be documented properly in the code itself.
Check the following questions for more information on how intellisense tooltip works :
How to get full intellisense tooltip comments working?
Documenting C++/CLI library code for use from c# - best tools and practices?
By default though, intellisense will simply display the comment above the function declaration or deninition (which ever comment is larger, it seems). It takes a while longer when you hover first time over a function, so be patient and retry :)
you can type in the code 3 slash /// and visual studio automaticalli write a xml template for the documentation of the method/class/property.
next you can go in the project properties. Build tab, Output section, XML documentation file, and enter the filename. It will be built on every build of the project.
You could try NDOC or SandCastle if you dont mind using 3rd party tools.

How to enable 'Insert Activex Control' in Visual Studio 2012 for a Win32 Dialog based application?

I am new to ActiveX Controls, though I have some basic background in COM/ATL programming.
Steps
The project is a simple Win32 project created using the Visual Studio 2012 wizard. I have selected all the default options. The dialog box is created using the resource editor dialog and then selecting new dialog option.
Problem
In my application I want to host the Internet Explorer (or some other) activex control in a dialog box. But the problem is that when I right click (as suggested by many sites and even msdn) the insert activex control ... is always disabled. I am not using MFC, but instead CAxDialogImpl (as described here).
Please suggest what I am doing wrong? How can I enable insert activex control ... in Visual Studio 2012 dialog editor?
I took considerable time to enable it, but the answer is simple: remove the macro "_APS_NO_MFC" in "resource.h" file.
A plain Win32 dialog does not have ActiveX container support, so the resource editor will not let you add the control.
You'll need to create a second project like an MFC dialog-based app, then copy the control information from its RC file.
CodeProject has some articles on using ActiveX controls without MFC, such as this one using parts of ATL - Win32 dialog helpers or this one that's pure C++ but similar to ATL's AxWindow - Use an ActiveX control in your Win32...