安装依赖

npm install --global --production windows-build-tools(在管理员权限打开的命令行中执行)
npm install -g node-gyp //依赖python2.7,包含在windows-build-tools中

安装 node-ffi

npm install ffi

 

安装ref

npm install ref
'use strict';
const path = require('path');
let ffi = require('ffi');
let mydll = path.join(__dirname, '../dll/helloworld.dll');
let dll= ffi.Library(mydll, {
    'helloworld': ['int', ['int']]
});

console.log(dll.helloworld(1));//关闭 RLM 通信端口

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
相关资源
相似解决方案