Hi, I'm a C# developer and downloaded the code from the article "HOW TO EXPORT QUOTES FROM METATRADER 5 TO .NET APPLICATIONS USING WCF SERVICES" ( https://www.mql5.com/en/articles/27 ). The problem is that my machine is a Windows 64 bits with MetaTrader 5 64 bits installed and I had to change the compile configurations to 64 bits in Visual Studio 2012. Ok, it compiled normally, then I added one new method that aims to return a string to MT5 which i called ReadBroker2MeInstructions . Compiled...
1) 如果你使用的是 x64 终端,很可能需要在 x64 下重新编译你的 C++ 项目。为了安全起见,你应该这样做:Visual Studio -> Properties(C++ 项目的属性)-> Configuration Manager(配置管理器)-> 并通过下拉列表或 <New...>(新建...>)将其更改为 x64。编译。完成。如果无法编译 - 检查项目的引用,查看编译器错误。
2) 我的 EA 出现了问题,甚至无法初始化。只有在断开 EA 与图表的连接 时,当 初始化失败 时,我才注意到这个问题(很有趣......)。EA 在初始化阶段陷入了无限睡眠 状态,而这一切都与这几行有关(在 QService.mqh 中):
QService::EnterCriticalSection()
{
while (GlobalVariableCheck("QService_CriticalSection") > 0)
Sleep(1);
GlobalVariableTemp("QService_CriticalSection");
}
经过调试和徒劳地尝试理解这个 "Sleep(1) "后,我将代码替换为 "Sleep(1)":
QService::EnterCriticalSection()
{
if(!GlobalVariableCheck("QService_CriticalSection"))
GlobalVariableTemp("QService_CriticalSection");
}
附:感谢文章作者!一切都很酷!
非常有趣......谢谢......不过,也许今天有更简单的选择*?
当然有 - 通过终端的内置功能进行连接。这是一个 PIPE 通道。
https://www.mql5.com/ru/docs/files/fileopen
刚刚根据这篇文章发布了一项新任务:https://www.mql5.com/en/job/34392。
它在我的 MT5 64 位环境中不起作用...
文章很棒!
谢谢
为了了解情况,我在我的 64 位机器上发现了问题所在。
经过几个小时的研究和调试,发现一个引用的程序集没有加载,产生了异常 "System.IO.FileNotFoundException:无法加载文件或程序集 'QExport.Service,Version=1.0.5771.13857,Culture=neutral,PublicKeyToken=56996a45dd1e337b'"。
也许是因为 dll 没有配置文件,还不清楚,MT 5 不知道从哪里找到程序集。因此它试图在基本路径(metaeditor64.exe 所在路径)中找到它。将引用项目 的输出目录更改为该路径后,MT 5 就能正常工作了。
嗨,乔、
有什么特别的技巧能让它在 x64 上运行吗?我刚编译了 x64 版,但启动时 dll 会崩溃并出现奇怪的错误。
Sabe,请看我下面的回答。
[]'s
您好、
我测试了您完成的文件,在 MT5 中一切正常。但 WinClient 中没有数据。
我想知道是否有预载历史柱状图的类似项目?我想将其全部添加到轻量级图表中,并方便地使用该图表。