Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在VS2012中创建C++/CLI Winforms应用程序?_Winforms_Visual Studio 2012_User Interface_C++ Cli - Fatal编程技术网

如何在VS2012中创建C++/CLI Winforms应用程序?

如何在VS2012中创建C++/CLI Winforms应用程序?,winforms,visual-studio-2012,user-interface,c++-cli,Winforms,Visual Studio 2012,User Interface,C++ Cli,我刚刚安装了Visual Studio 2012 express for Desktop。我不能看到任何地方用C++来创建GUI应用程序!Windows窗体应用程序在Visual C++ 2010中存在的位置在哪里?这些拖放控件在哪里?我安装它是因为我得到了支持GUI intellisense的详细信息,这是一个不可靠的提示,他们希望您停止创建C++/CLI Winforms应用程序。然而,至少在VS2012和VS2013年,管道系统仍然存在。在未来的情况下,情况可能并非如此 您可以通过以下步骤

我刚刚安装了Visual Studio 2012 express for Desktop。我不能看到任何地方用C++来创建GUI应用程序!Windows窗体应用程序在Visual C++ 2010中存在的位置在哪里?这些拖放控件在哪里?我安装它是因为我得到了支持GUI intellisense的详细信息,这是一个不可靠的提示,他们希望您停止创建C++/CLI Winforms应用程序。然而,至少在VS2012和VS2013年,管道系统仍然存在。在未来的情况下,情况可能并非如此

您可以通过以下步骤将CLR控制台应用程序转换为Winforms应用程序:

从文件+新建+项目、CLR节点、CLR控制台应用程序开始 Project+添加新项、UI节点、Windows窗体 项目+属性、链接器、系统、子系统=Windows 项目+属性,链接器,高级,入口点=主 将预生成的.cpp文件更改为如下所示:

#include "stdafx.h"
#include "MyForm.h"

namespace ConsoleApplication45 {    // Change this!!
    using namespace System;
    using namespace System::Windows::Forms;

    [STAThread]
    int main(array<System::String ^> ^args)
    {
        Application::EnableVisualStyles();
        Application::SetCompatibleTextRenderingDefault(false); 
        Application::Run(gcnew MyForm());
        return 0;
    }
}
对于以x64为目标的项目,复制粘贴:

?mainCRTStartupStrArray@@$$FYMHP$01EAPE$AAVString@System@@@Z

在VS2017的某个地方,设计师无法打开一个带有神秘错误消息的新表单。解决方法是首先构建项目,使用build>build。

@chris::O:O。。。好的,但这是哪里?我不确定GUI生成器,但它可能会与CLR项目一起硬编码工作。谢谢你的回复。我将放弃C++/CLI:@Hans Passant他们想让你创建Windows应用商店应用程序吗?@Hans Passant,我们可以了解更多信息吗?如果微软公司想逐步淘汰它,什么是C++的替代品?你应该问微软。他们唯一的C++意图是MFC和WRET,绝大多数程序员使用C语言或JavaScript等语言来创建GUI。
?mainCRTStartupStrArray@@$$FYMHP$01EAPE$AAVString@System@@@Z