The designer could not be shown for this file because none of the classes within it can be designed

后端 未结 11 2527
一个人的身影
一个人的身影 2020-12-09 14:53

We have the following shared component:

public class OurServiceBase : System.ServiceProcess.ServiceBase

This class has functionality we wan

11条回答
  •  庸人自扰
    2020-12-09 15:27

    1. Go to Project>>Properties>>Linker>>System, in the field "SubSystem" you choose "Windows (/SUBSYSTEM:WINDOWS)", click Apply.

    2. Go to Project>>Properties>>Linker>>Advanced, in the field "entry point", input value "Main" and Apply, finally click OK.

    3. Go to file code of form you created(ex: MyForm.cpp) and input code bellow to this file:

    using namespace System;

    using namespace System::Windows::Forms;

    [STAThreadAttribute]

    void Main(array^ args)

    {

    Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); Project1::MyForm form; Application::Run(%form);

    }

    1. Save and rebuild.

提交回复
热议问题