blog:2023-11-15_visual_c_winform_project_startup
Project Setting
New CLR empty project
Create Project. Here, we named it as “CPP CLR Test”
Project → Property → Linker → System → SubSystem
Project → Property → Linker → Advanced → Entry Point
Header Files → Add UI → Windows Form
We cannot edit the MainForm by FormEditor, just close the project and launch the Visual Studio again
Now, we can edit it by Form Editor
Add the main() in MainForm.cpp
-
#include "MainForm.h"
using namespace System;
using namespace System::Windows::Forms;
void main(array < String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
CPPCLRTest::MainForm form;
Application::Run(% form);
}
Now, we can compile and run it
Permalink blog/2023-11-15_visual_c_winform_project_startup.txt · Last modified: 2023/11/23 09:21 by
jethro