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でコンパイルしました。
しかし、ロードはできますが、未解決のインポート関数呼び出しがあります。
どうすれば解決できますか?
2014.03.05 20:39:59.220UnmanagedExportsDLLExample1(XAUUSD,H1)unresolved import function call
2014.03.05 20:39:59.220 UnmanagedExportsDLLExample1 (XAUUSD,H1) 'Testme.dll'で'Add'が見つかりません。
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テンプレートを理解する限り...
このメッセージは半年以上前に残されたものです。あれから何か変わったのでしょうか?
方法1
64win7、vs2012 C#。所有者のtestme.zipテンプレートファイルをダウンロードした。
プロンプトの途中でいくつかのエラー(パスが間違っている、ファイルが見つからない、などなど)が、解決されました。
しかし、最終的には、まだ表示され、同じ問題の上に。私はそれが今解決されているかわからない?どのような方法で解決する。
方法2:
NuGetはRGieseckeパッケージをインストールしました。
https://www.nuget.org/packages/UnmanagedExports/1.2.6
201311の最新バージョンでは
Error 2 C:■AppData■Local■Temp■tmp8B24■dllTest.il(58) : error : syntax error at token '{' in: {
dllTest
あなたは、IJWの助けを借りて、C + +ストリッパーを使用することができますし、コンパイラの手段によって純粋に単一の 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が完全にクラッシュしてしまいます。
ありがとうございます。
はい、しばらくしたらDLLの使い方について新しい記事を書きます。そこには多くの興味深いことが追加されています。
それまでは、議論中の記事の例を使うことができます。複雑なことは何もありません。
そして...いつまで待つ?1年、2年...それとも10年?
もう3年になる。冒頭の記事によれば、DLLから メソッドをインポートする ことはできない。例はどこにある?
この記事をどうもありがとう。この記事を参考に、オープンソースのC#用MQLライブラリを作りました。
https://github.com/jseparovic/MQL4CSharp
これはまだ開発中で、現時点ではテストされていませんが、最初のテストではこのアイデアは動作することがわかりました。
C#からコマンドを送信する方法は非常に基本的で、C#コードが実行されるスレッドと、通信用のゲッター/セッターを使用します。MQLはミリ秒ごとに待機コマンドをポーリングし、C#コードは結果が書き込まれるまでブロックすることができます。
C#でストラテジーを実装する方法の例として、https://github.com/jseparovic/MQL4CSharp/blob/master/MQL4CSharp/UserDefined/Strategy/MaCrossStrategy.cs。
ありがとう、
ジェイソン