安裝依賴
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 通信端口