c ++ CLR表单应用程序问题(无法保存,因为“不支持此类接口”,无法访问表单设计) [英] c++ CLR Forms Application issues (Can't save because "No such interface is supported", Can't access Forms Designs)

查看:113
本文介绍了c ++ CLR表单应用程序问题(无法保存,因为“不支持此类接口”,无法访问表单设计)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我不是遇到以下问题的第一个人,我使用的是最新版本的Visual Studio。


服用后在c ++课程中,我决定测试自己的能力并制作一些随机的c ++表单应用程序。


问题是,当我创建表单时,我会得到一个窗口告诉"为了防止可能的数据丢失在加载设计器之前,必须解决以下错误:"


"完成此操作所需的数据尚不可用。 (HRESULT的异常:0x8000000A)"


所以我确实在线找到了一个解决方案,指示我关闭并重新打开设计。关键是当右键单击表单时,缺少在设计编辑器中打开它的选项。


所以我决定在这个论坛上写一篇文章,我试图保存我的项目。在这里我又得到了一个错误:"操作无法完成,没有支持这样的接口。"




声称遇到此问题的其他用户只是回复了诸如" ;更新您的visual Studio","我们将调查那个"但这从来没有得到解决。我做错了什么还是这个错误?

解决方案

嗨darkmesa,


Don不用担心,关闭它并将以下代码添加到MyForm.cpp:

使用命名空间系统; 
使用命名空间System :: Windows :: Forms;

[STAThreadAttribute]
void Main(array< String ^> ^ args){
Application :: EnableVisualStyles();
Application :: SetCompatibleTextRenderingDefault(false);
Project1 :: MyForm表格;
Application :: Run(%form);
}





然后保存并关闭Visual Studio 2017,然后重新打开您的项目。


注意: 当您重新打开项目时,请先调试它:



显示:





现在,您可以通过双击MyForm.h在表单中进行选择:









请参阅完成的步骤,了解如何创建C ++表单项目如下:


Visual Studio 2017 - Windows窗体


最好的问候,


Stanly



DISCLAIMER: I am not the first Person who encounters the following issues and I am using the Latest version of Visual Studio.

After taking a c++ Course, I decided to tests my abilities and make some random c++ Forms Application.

The problem is that when I create forms, I get a window telling "To prevent possible data loss before loading the designer, the following errors must be resolved: "

"The data necessary to complete this operation is not yet available. (Exception from HRESULT: 0x8000000A)"

So I did find a solution online that instructed me to close and re-open the Design. The point is that when Right-Clicking on the Form, the option to open it in Design editor was missing.

So I decided to write a post on this forum, and I tried to save my project. And here I got yet another error: "The operation could not be completed, no such interface supported."



Other users who claimed to have this issue simply had replies such as "Update your visual Studio", "We'll look into that" but this never got fixed. Am I doing something wrong or is this a bug?

解决方案

Hi darkmesa,

Don't worry, close it and add the following code to the MyForm.cpp:

using namespace System;
using namespace System::Windows::Forms;

[STAThreadAttribute]
void Main(array<String^>^ args) {
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false);
	Project1::MyForm form;
	Application::Run(%form);
}


Then save it and close the Visual Studio 2017, then reopen your Project.

Note: When you reopen your Project, debug it first:

And the display:


Now you can do your options in the form by double click MyForm.h:



Please refer to the completed steps for how to create a C++ Form project as below:

Visual Studio 2017 - Windows Forms

Best Regards,

Stanly


这篇关于c ++ CLR表单应用程序问题(无法保存,因为“不支持此类接口”,无法访问表单设计)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆