From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



WindowsでDLLを検索する場所はどこですか?



使用ソフトウェア:
使用ソフトウェア・バージョン: 9.0
使用ソフトウェア・バージョンに特化:
二次のソフトウェア: LabVIEW Development Systems>>LabVIEW Full Development System

問題:
LabVIEWもしくはLabWindows/CVIコードからDLLを呼び出したいのですが、DLLが見つかりませんというエラーが発生します。WindowsがDLLを探す場合、どこから検索するのでしょうか?

解決策:
Windowsでは、明示的なリンクもくしくは黙示的なリンクを使用したDLLを呼び出す場所にかかわらず、以下の順序でDLLを検索します。
  1. 現在のプロセスにある実行可能モジュールのディレクトリ
  2. 現在のディレクトリ
  3. Windowsシステムディレクトリ
    Windows SDKの関数である「GetSystemDirectory」を使用してこのディレクトリのパスを得ることができます。
  4. Windowsディレクトリ
    Windows SDKの関数である「GetWindowsDirectory」を使用してこのディレクトリのパスを得ることができます。
  5. 環境変数のパスにリストされたディレクトリ(そのリストに表示された順序)




関連リンク:
KnowledgeBase 21SE44PR: Using the Windows SDK in LabWindows/CVI
KnowledgeBase 4BJGH6GJ: How Do I Call a Dynamic Link Library (DLL) from LabVIEW?
DeveloperZone チュートリアル: Calling DLLs in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Static)
DeveloperZone サンプルプログラム: Calling DLLs in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Static)

添付:





報告日時: 02/05/2009
最終更新日: 05/20/2009
ドキュメントID: 4U4EC9PE