問題タブ [setdlldirectory]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
1949 参照

c# - SetDllDirectory が機能しない ( DllNotFoundException )

同じ DllImport 呼び出しを使用して、32/64 ビットのネイティブ dll をロードしようとしています。

ディレクトリ構造:

根:

  • アプリケーション.exe
  • /win64/
    • stb_image.dll
  • /win32/
    • stb_image.dll

このソリューションを使用してみましたが、成功していないことがわかります。

たとえば、この関数呼び出し:

しかし、DllNotFoundException が発生するため、機能しません。

私が SetDllDirectory を使用している方法:

これは私のプログラムの最初の呼び出しなので、正しいパスを設定する必要があります。また、true を返します。

しかし、(私の場合) 64 ビットのネイティブ dll を exe のディレクトリに配置すると、DllDirectory を別のパスに設定しても機能します。

何か助けはありますか?