#pragma once using namespace System; using namespace System::Collections; using namespace System::ServiceProcess; using namespace System::ComponentModel; [!output SAFE_NAMESPACE_BEGIN] /// /// Summary for [!output SAFE_NAMESPACE_NAME]WinService /// /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. public ref class [!output SAFE_NAMESPACE_NAME]WinService : public System::ServiceProcess::ServiceBase { public: [!output SAFE_NAMESPACE_NAME]WinService() { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// /// Clean up any resources being used. /// ~[!output SAFE_NAMESPACE_NAME]WinService() { if (components) { delete components; } } /// /// Set things in motion so your service can do its work. /// virtual void OnStart(array^ args) override { // TODO: Add code here to start your service. } /// /// Stop this service. /// virtual void OnStop() override { // TODO: Add code here to perform any tear-down necessary to stop your service. } private: /// /// Required designer variable. /// System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) { this->components = gcnew System::ComponentModel::Container(); this->CanStop = true; this->CanPauseAndContinue = true; this->AutoLog = true; this->ServiceName = L"[!output SAFE_NAMESPACE_NAME]WinService"; } #pragma endregion }; [!output SAFE_NAMESPACE_END]