---
title: "调用 C++ 的 DLL (与 MS Visual Studio 集成) - 开发程序 - MetaEditor 帮助"
description: "当以 MQL4/MQL5 开发交易程序时，您可以轻松地使用第三方 C++ DLL。 您可以编辑 С++ 源代码文件 (CPP 和 H) ，如同 MQ4, MQ5 和 MQH 一样。 DLL 中的这些文件也可以直接从编辑器编译。 安装在用户 PC 上的... - 调用 C++ 的 DLL (与 MS Visual Studio 集成) - 开发程序 - MetaEditor 帮助"
image: "https://www.metatrader5.com/i/logo_metatrader5.png"
url: "https://www.metatrader5.com/zh/metaeditor/help/development/c_dll"
---

[MetaEditor 帮助](https://www.metatrader5.com/zh/metaeditor/help) → [开发程序](https://www.metatrader5.com/zh/metaeditor/help/development) → 调用 C++ 的 DLL (与 MS Visual Studio 集成)

# 调用 C++ 的 DLL (与 MS Visual Studio 集成)

当以 MQL4/MQL5 开发交易程序时，您可以轻松地使用第三方 C++ DLL。 您可以编辑 С++ 源代码文件 (CPP 和 H) ，如同 MQ4, MQ5 和 MQH 一样。 DLL 中的这些文件也可以直接从编辑器编译。 安装在用户 PC 上的 Microsoft Visual Studio 可用于此目的。 若要进行编译，请打开 C++ 文件并按 F7 (编译命令)。

![操控 C++ 的 DLL](https://www.metatrader5.com/i/help/metaeditor/en/compile_dll.png)

> 安装在用户 PC 上的 MS Visual Studio 编译器用于编译 C++ 源代码。 支持 MS Visual Studio 2008 及更高版本 (包括 Express 和 Community 版本)。若要手动指定编译器路径，请转到[设置部分](https://www.metatrader5.com/zh/metaeditor/help/beginning/settings#compiler)。MS Visual Studio 版本 (32 或 64 位) 应该与 MetaEditor 版本匹配。

MetaEditor 还提供了将导出的 DLL 函数轻松添加到 MQL4/MQL5 文件的能力。 简单地将 DLL 文件从 [导航器](https://www.metatrader5.com/zh/metaeditor/help/workspace/navigator) 窗口拖拽到打开的 MQ4、MQ5 或 MQH 文件里。

![从 DLL 导入函数](https://www.metatrader5.com/i/help/metaeditor/en/dll_import.png)

## In this section

- [智能管理](https://www.metatrader5.com/zh/metaeditor/help/development/intelligent_management)
- [查找和替换](https://www.metatrader5.com/zh/metaeditor/help/development/source_code_find)
- [样板](https://www.metatrader5.com/zh/metaeditor/help/development/styler)
- [编译](https://www.metatrader5.com/zh/metaeditor/help/development/compile)
- [MQL5 云端保护: 为程序提供先进的保护](https://www.metatrader5.com/zh/metaeditor/help/development/mql5_cloud_protector)
- [代码调试](https://www.metatrader5.com/zh/metaeditor/help/development/debug)
- [代码分析](https://www.metatrader5.com/zh/metaeditor/help/development/profiling)
- [AI Assistant编码助手](https://www.metatrader5.com/zh/metaeditor/help/development/ai_assistant)
- [生成包含代码](https://www.metatrader5.com/zh/metaeditor/help/development/generate_mqh)
- 调用 C++ 的 DLL (与 MS Visual Studio 集成)
- [使用Python](https://www.metatrader5.com/zh/metaeditor/help/development/python)
- [OpenCL 支持](https://www.metatrader5.com/zh/metaeditor/help/development/opencl)

```json
{"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ {"@type": "ListItem", "position": 1, "item": {"@id": "https://www.metatrader5.com/zh/metaeditor/help", "name": "MetaEditor 帮助"}}, {"@type": "ListItem", "position": 2, "item": {"@id": "https://www.metatrader5.com/zh/metaeditor/help/development", "name": "开发程序"}}, {"@type": "ListItem", "position": 3, "item": {"@id": "https://www.metatrader5.com/zh/metaeditor/help/development/c_dll", "name": "调用 C++ 的 DLL (与 MS Visual Studio 集成)"}} ]}
{ "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{ "@type": "Question", "name": "MetaTrader 5: 调用 C++ 的 DLL (与 MS Visual Studio 集成)", "acceptedAnswer": { "@type": "Answer", "text": "当以 MQL4/MQL5 开发交易程序时，您可以轻松地使用第三方 C++ DLL。 您可以编辑 С++ 源代码文件 (CPP 和 H) ，如同 MQ4, MQ5 和 MQH 一样。 DLL 中的这些文件也可以直接从编辑器编译。 安装在用户 PC 上的 Microsoft Visual..." } }] }
```
