【问题标题】:How to change the location/path of unmanaged C libraries in VB.Net when using the P/Invoke layer?使用 P/Invoke 层时如何更改 VB.Net 中非托管 C 库的位置/路径?
【发布时间】:2010-02-26 06:25:40
【问题描述】:

目前在我们的 VB.Net windows 应用程序中,C 库存在于“bin”目录下,但我们希望将其存储在存在其他窗体和类的应用程序根目录下......我们如何在 Vb 中做到这一点。 2008 年净额?

【问题讨论】:

    标签: vb.net interop pinvoke


    【解决方案1】:

    P/Invoke 层使用rules that the LoadLibrary API function 来查找您使用 DllImport 属性指定的 DLL。

    话虽如此,您应该查看 LoadLibrary API 函数的备注部分,因为 dllName parameter for the constructor of the DllImportAttribute 最终是作为 LoadLibrary 函数的 lpFileName 参数名称传递的内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多