We have the following shared component:
public class OurServiceBase : System.ServiceProcess.ServiceBase
This class has functionality we wan
Go to Project>>Properties>>Linker>>System, in the field "SubSystem" you choose "Windows (/SUBSYSTEM:WINDOWS)", click Apply.
Go to Project>>Properties>>Linker>>Advanced, in the field "entry point", input value "Main" and Apply, finally click OK.
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
{
Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false);
Project1::MyForm form; Application::Run(%form);
}