分享

vs2015 没有 Windows Forms Application for C++

 望穿墙 2018-04-04

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):

    1. Make a "CLR Empty Project".
    2. Press Ctrl-Shift-A and create a Windows Form (under UI).
    3. 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]);
      }
      
    4. Right click your project in the Solution Explorer and click Properties.

    5. Under Configuration Properties > Linker > Advanced, change Entry Point to "main" (without quotation marks).
    6. Under Configuration Properties > Linker > System, change SubSystem to "Windows (/SUBSYSTEM:WINDOWS)" (without quotation marks).

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多