MFC Ribbon imports as XML instead of opening designer after saving - c++

I made a resource file from scratch - I renamed an empty .txt file to .rc and then opened it in Visual Studio. Then I added a ribbon, a dialog, etc. to it. Then I saved and quit. When I reopened the file again, Visual Studio complained:
error RC2144 : PRIMARY LANGUAGE ID not a number
... which was fixed by adding #include <windows.h> in the resource.rc file.
But when I opened the file again, I got this:
MFC Ribbon Error RT_RIBBON_XML
Visual Studio seems to import the ribbon as an "RT_RIBBON_XML" type, not as a "Ribbon" like usual. As you can see, it says that there's an "external file" - and yes, the ribbon XML itself is in a seperate file in the same directory. But I can't open the ribbon in the designer anymore, it just shows the XML instead of the Ribbon designer. How can I tell Visual Studio that this XML is indeed a ribbon?
I have tried importing the ribbon via "Add resource > Import", but I can't import it as a "Ribbon" type, but Visual Studio says it's not allowed to open an external type as a built-in type.
I've tried making a new ribbon, then opening the data and copy-pasting from my old ribbon into the new ribbon. The ribbon gets saved correctly, but Visual Studio doesn't open the file anymore, meaning: When I open the file in a text editor, I can see all my attributes, but when opening it in the designer, it's simply an empty ribbon. How can I load my original ribbon?

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.

Customise Visual Studio 2017 toolbar - open a specific file

Short of writing a VS add-in, is there a way to add a button to a VS toolbar which opens a specific xml file from a fixed location in a new editor window?
You can use my Favorite Documents extension to add a link to a file and then open it from the Favorites menu.

Visual Studio can't show folder of C++ files

I have used Visual Studio 2017 to open a vs2010 MFC project.
It could be opened well in the first time.
However, afterwards, it reminds me to do some update. After that, the file cannot be load in the resource view.
How to reconfigure Visual Studio 2017 to show the resource view?
To open the resource view window Click Resource View on the View menu or Press CTRL + SHIFT + E. But if you mean why the load failed it may be a data crash depending on the situation.

where is the code generated by visual studio controls editor for visual c++?

When I make a dialog with visual c++ editor, I would see the code generated by my editor to make the window components..It's possible? When I double-click on a component, I see only the handler
The controls/components of a Dialog Box are described in a Resource Template, in a RC file. In the Solution Explorer, right click on the RC file in "Resource Files" and then choose "Open with..." and select "C++ Code Editor".
The link between the content of the RC file and the C++ code creating the Dialog Box at Run Time is done via the CreateDialog API, or one of his cousin, as CreateDialogParam.

Visual Studio 2010 resource tree doesn't open

I'm having a problem with visual studio 2010 in that I have a MFC project I've made which includes a dialog box. However when I go to the resource view, I can see the .rc file (I can't see the .rc2 file, which is listed in the solution explorer) but when I click on it, it doesn't open into the expected ICON, DIALOG, MENU etc.
The project runs and compiles fine, but I just don't get why I can't get to the dialog to edit it.
Thanks
James