Skip to content

Commit 59c5215

Browse files
Initial commit
1 parent d282587 commit 59c5215

40 files changed

Lines changed: 6336 additions & 0 deletions

README.html

Lines changed: 706 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Newcomers's-EuroScope-Plugin / 新手的第一个EuroScope插件
2+
3+
## Visual Studio配置方法
4+
5+
### 前期准备
6+
7+
- X86架构的电脑
8+
- 已安装并配置大部分环境的Visual Studio 2022
9+
- 合格的网络环境
10+
- 一个聪明的大脑
11+
12+
### 操作步骤
13+
14+
1. 前往`%appdata%/EuroScope/PlugIn/`复制`EuroScopePlugIn.h``EuroScopePlugInDll.lib`
15+
16+
2. 创建Visual Studio项目,点击“创建新项目(<u>N</u>)”
17+
18+
![image-20250705162348634](./assets/image-20250705162348634.png)
19+
20+
3. 搜索“MFC 动态链接库”,选择点击”下一步(<u>N</u>)“
21+
22+
![image-20250705162448904](./assets/image-20250705162448904.png)
23+
24+
4. 点击“将解决方案和项目放在同一目录(<u>D</u>)”,在`项目名称(<u>J</u>)”填写你的插件名称,例如“MyEuroScopePlugIn”,,选择“位置(<u>L</u>)”。点击“创建(<u>C</u>)”
25+
26+
![image-20250705162715473](./assets/image-20250705162715473.png)
27+
28+
5. 点击“确认”即可
29+
30+
![image-20250705163328526](./assets/image-20250705163328526.png)
31+
32+
6. 在项目根目录创建`include`文件夹,将步骤1提到的`EuroScopePlugIn.h``EuroScopePlugInDll.lib`复制到里面
33+
34+
![image-20250705165638516](./assets/image-20250705165638516.png)
35+
36+
7. 在顶部菜单栏依次点击项目(<u>P</u>)、属性(<u>P</u>)
37+
38+
![image-20250705163424992](./assets/image-20250705163424992.png)
39+
40+
8. 依次点击“高级”、“字符集”、“试用多字节字符集”
41+
![image-20250705163736209](./assets/image-20250705163736209.png)
42+
43+
9. 依次点击“常规”、“附加包含目录”,输入`include`
44+
45+
![image-20250705164618021](./assets/image-20250705164618021.png)
46+
47+
10. 依次点击“语言”、“将 WChar_t 视为内置类型”,选择“否 (/Zc:wchar_t-)”
48+
49+
![image-20250705164806052](./assets/image-20250705164806052.png)
50+
51+
11. 依次点击“输入”、“附加依赖项”,输入`include/EuroScopePlugInDll.lib`
52+
53+
![image-20250705165020113](./assets/image-20250705165020113.png)
54+
55+
12. 点击“确定”
56+
57+
13. 对源文件右键“添加(<u>D</u>)”、“类(<u>C</u>)...”
58+
59+
![image-20250705184814753](./assets/image-20250705184814753.png)
60+
61+
14. 填写类名(L)和基名(B),
62+
63+
> [!WARNING]
64+
>
65+
> 类名(L):C+你想要的名称。例如:CESPlugIn(C-EuroScope-PlugIn)
66+
>
67+
> 基类(B):必须填写`CPlugIn`,注意“C”、“P”、“I”均为大写
68+
69+
![image-20250705185238730](./assets/image-20250705185238730.png)
70+
71+
15. 点击确定
72+
73+
16. 在“解决方案配置”和“解决方案平台”选择“Release”和“x86”模式
74+
75+
![image-20250705190241010](./assets/image-20250705190241010.png)
76+
77+
17. 在右侧的解决方案资源管理器打开`CESPlugIn.h`
78+
79+
![image-20250705190502497](./assets/image-20250705190502497.png)
80+
81+
18. 增加include和命名空间
82+
83+
```c++
84+
#pragma once
85+
#include <EuroScopePlugIn.h>
86+
87+
using namespace EuroScopePlugIn;
88+
89+
class CESPlugIn :
90+
public CPlugIn
91+
{
92+
};
93+
```
94+
95+
19. 替换CESPlugIn.cpp内的内容
96+
97+
```c++
98+
#include "pch.h"
99+
#include "CESPlugIn.h"
100+
#include <string>
101+
102+
CESPlugIn* pMyPlugIn = nullptr;
103+
104+
void __declspec (dllexport)
105+
EuroScopePlugInInit(EuroScopePlugIn::CPlugIn** ppPlugInInstance)
106+
{
107+
*ppPlugInInstance = pMyPlugIn =
108+
new CESPlugIn();
109+
}
110+
111+
void __declspec (dllexport)
112+
EuroScopePlugInExit(void)
113+
{
114+
delete pMyPlugIn;
115+
}
116+
117+
CESPlugIn::CESPlugIn(void)
118+
:CPlugIn(EuroScopePlugIn::COMPATIBILITY_CODE,
119+
"Your Plugin name",
120+
"x.x.x",
121+
"Your name",
122+
"Your LICENSE")
123+
{
124+
using namespace std;
125+
for (int i = 1; i <= 10000; i++) {
126+
DisplayUserMessage("NOTAM", "DearAuthor", string("Congratulations! 'Hello World!' No." + std::to_string(i)).c_str(), 1, 0, 0, 0, 0);
127+
}
128+
}
129+
```
130+
131+
20. 如遇错误,点击“显示可能的修补程序(Alt + Enter 或 Ctrl + .)”、“创建’CESPlugIn‘的声明(在 CESPlugIn.h中)(<u>D</u>)”
132+
133+
![image-20250705191729169](./assets/image-20250705191729169.png)
134+
135+
![image-20250705191755527](./assets/image-20250705191755527.png)
136+
137+
21. 此时发现还有错误,在`CESPlugIn.h`中`CESPlugIn(void);`上行加入`public:`
138+
139+
![image-20250705191945362](./assets/image-20250705191945362.png)
140+
141+
22. 点击“生成(<u>B</u>)、“生成解决方案(<u>B</u>)”或点击快捷键`F7`即可
142+
143+
![image-20250705192327638](./assets/image-20250705192327638.png)
144+
145+
### 模板提供
146+
147+
懒得一步一步写代码了?在本文的`src`文件夹内提供现成的模板哦!
148+
149+
## 鸣谢
150+
151+
- [*Gergely Csernák*](mailto:info@euroscope.hu)
152+
- [*Misaka-Nnnnq*](https://github.com/Misaka-Nnnnq)
153+
- [*XiaoZhang*](https://github.com/XiaoZhang-store/)
154+
- [*Master Gui*](https://github.com/supermastergui)
155+
- 以及 [Vatsim People's Republic of China division](https://www.vatprc.net/zh-cn)
156+
157+
## 许可证
158+
159+
本项目采用[`MIT许可证`](https://github.com/supermastergui/EuroScope-PlugIn-Tutorial/blob/main/LICENSE)开源

assets/image-20250705162348634.png

5.24 KB
Loading

assets/image-20250705162448904.png

38.9 KB
Loading

assets/image-20250705162715473.png

23.3 KB
Loading

assets/image-20250705163328526.png

7.93 KB
Loading

assets/image-20250705163424992.png

58.5 KB
Loading

assets/image-20250705163736209.png

56 KB
Loading

assets/image-20250705164618021.png

53.1 KB
Loading

assets/image-20250705164806052.png

54.4 KB
Loading

0 commit comments

Comments
 (0)