A set of compile-time libraries (nothing to deploy) and a build task that enable you to export functions from managed code to native applications. That means, you can create plugins in a managed language like C# or F# for native applications that only have a C-Api (like Notepad++). The nuget package is all you need. Just mark your methods with [DllExport] and build for x86, x64 or ia64. Hints: - You have to set your platform target to either x86, ia64 or x64. AnyCPU assemblies cannot export functions. - The export name defaults to the method name and the calling convention to stdcall. If that's all what you want, you can just use [DllExport] without parameters. - You cannot put your exports in generic types or export generic methods. (The CLR wouldn't know what type parameters to use)
In comparison to the question above i need to combine DLLs so that final mixed DLL could export their functions to other unmanaged applications. For this i would like to compile them both as .netmodule and then combine them into one file with a linker so i have : 1) Libs - project with some library in C# - it does not have any dependencies...
I also provided several examples on how to marshal MQL5 structures against C# and how to invoke exported DLL functions in MQL5 scripts. - Page 2 - Category: articles, library comments
我是64的win 8
用vs2013编译的
但是 可以加载了 但是 出现了 unresolved import function call
如何解决?
2014.03.05 20:39:59.220 UnmanagedExportsDLLExample1 (XAUUSD,H1) unresolved import function call
2014.03.05 20:39:59.220 UnmanagedExportsDLLExample1 (XAUUSD,H1) Cannot find 'Add' in 'Testme.dll'
2011.10.29 20:13:37 2000.01.03 00:00 Expert_NN_1_1 USDJPY,H1: cannot call function 'sum' from dll 'NN 1 DLL.dll' (error 127)
你好、
我也遇到了类似的错误。你是如何解决的?
2014.03.28 22:16:41.199 2014.03.25 23:59 未解决的导入函数调用
2014.03.28 22:16:41.199 2014.03.25 23:59 无法在 "Testme.dll "中找到 "Set2DArray"。
据我所知,RGiesecke UnmanagedExportLibrary 模板...
这条留言是半年前留下的。之后有什么变化吗????
方法一:
我是64的win 7,vs2012 C#。下载楼主的 testme.zip模板文件。
中间提示了几个错误(路径不对,文件丢失等之类的),已经解决了。
但最后,还是出现和和楼上同样的问题。不知道现在解决了没有?什么方法解决的。
方法二:
NuGet 安装的 RGiesecke包.
https://www.nuget.org/packages/UnmanagedExports/1.2.6
2013年11年最新的版本,提示
错误 2 C:\Users\Administrator\AppData\Local\Temp\tmp8B24\dllTest.il(58) : error : syntax error at token '{' in: {
dllTest
您可以在 IJW 的帮助下使用 C++ stripper,然后纯粹通过编译器-链接器将所有内容合并为一个 DLL,不需要使用文章中描述的模板进行变态操作,这里有简要描述 -http://stackoverflow.com/questions/26226958/include-managed-c-sharp-dll-into-unmanaged-c-dll-all-in-one-single-file。
好吧,用 RGiesecke 模板描述的方法--这是一个黑客程序,迟早会停止工作,顺便说一句,我也没有工作......但是,如果有人还想玩文章中描述的 IL 方法,还有一辆自行车,但它也不起作用 -https://github.com/winch/winch.pinkbile.com-c-sharp/tree/master/dll_tool/dll_tool。
你好、
有人能向 dll 发送包含字符串变量的结构吗?
我可以发送 int、double 和 float,但字符串变量却出现了这个错误:
Access violation read to 0x0000007B这是我的 C# 结构:
这里是 mql4 结构:
我试着将字符串变量编入结构,但 MT4 完全崩溃,没有任何错误,只是挂起并在窗口中崩溃。
谢谢。
是的,过段时间我们会写一篇关于使用动态链接库的新文章。那里已经添加了很多有趣的内容。
在此期间,您可以使用正在讨论的文章中的示例。这篇文章并不复杂。
还有 ...还要等多久?一年、两年...还是 10 年?
已经 3 年了。根据开头提到的文章,从dll 中导入 方法是不可能的。例子在哪里?
非常感谢这篇文章。我利用这里的想法为 C# 构建了这个开源 MQL 库。
https://github.com/jseparovic/MQL4CSharp
该库仍在开发中,目前尚未经过测试,但初步测试表明其想法是可行的。
它从 C# 发送命令的方式非常简单,使用线程让 C# 代码在其中运行,并使用 getters/setters 进行通信。MQL 每毫秒轮询一次等待命令,而 C# 代码可以阻塞直到写入结果。
请查看 https://github.com/jseparovic/MQL4CSharp/blob/master/MQL4CSharp/UserDefined/Strategy/MaCrossStrategy.cs,了解如何用 C# 实现策略。
干杯
杰森