项目中需要调用一个 USB接口的设备,用WPF写上位机,设备提供了C++的动态链接库。

按照已找到的资料,将 .dll  .h  和相关依赖项都放在 程序的运行目录中,执行,会报错,找不到“XXX.dll”,把文件放到 system32目录下 就不会提示找不到

[DllImport("sa_api.dll", ExactSpelling = false)]
 public extern static string saGetAPIVersion();

以上为引用方式。

还有东西需要转换,

目前参考:

需要转换的,指针转为什么, 数组转为什么 之类的。

http://dongtingyueh.blog.163.com/blog/static/461945320124239215442/

http://www.cnblogs.com/Bonker/p/4142123.html

相关文章:

  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-11-07
猜你喜欢
  • 2021-12-18
  • 2021-08-31
  • 2022-12-23
  • 2021-11-13
  • 2021-06-19
相关资源
相似解决方案