Make CLR Windows Form Project by C++/CLI in Visual Studio 2019
因為公司的 Debug UI 是使用 C++/CLI 去做的,簡單紀錄專案怎麼建立。
1. 在 Visual Studio 2019 安裝 C++/CLI
2. 建立 CLR WinForm 專案
建立新專案 — 選擇 CLR 空白專案 (.NET Framework)
設定專案名稱、路徑及 .NET 架構
選擇建立之後會進入開發介面
3. 設定桌面應用程式設定
對專案按右建 >> 屬性 >> 進入屬性設定頁面
組態屬性 >> 連結器 >> 系統 >> 子系統 >> 選擇 Windows
組態屬性 >> 連結器 >> 進階 >> 進入點 >> 輸入 main
4. 新增 UI 項目
對專案按右建 >> 加入 >> 新增項目
新增項目 >> Visual C++ >> UI >> Windows Form
5. 重新啟動 Visual Studio 2019 並開啟專案
開啟標頭檔 >> MyForm.h >> 出現設計視窗
6. 在 MyForm.cpp 新增主函式 main()
#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThreadAttribute]
void main(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
MyProject::MyForm form; // MyProject 需根據專案名稱進行替換
Application::Run(% form);
}
526 則留言
LorenMep
is there a generic cialis available in the us: TadalAccess – cialis drug
Frankiemef
https://tadalaccess.com/# where to buy cialis over the counter
JosephSom
cialis free sample Tadal Access cialis slogan
Frankiemef
https://tadalaccess.com/# generic cialis tadalafil 20mg india
Scottemips
order cialis no prescription: Tadal Access – order cialis online cheap generic