Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 655 Bytes

README.md

File metadata and controls

25 lines (21 loc) · 655 Bytes

electron-call-dll

why used addon? not ffi?

we know use the node-ffi to call dll is easly but in >electron5 [node.js 12+], node-ffi cannt working well (because node-ffi used node.js 8) so we need to use the addon to call dll.

i used this node-addon-api to call the add.dll.

add.dll src

#include "stdafx.h"
extern "C" _declspec(dllexport) int Add(int x, int y)
{
	int result = x + y;
	return result;
}

how to start?

  • npm install --global windows-build-tools
  • npm install
  • npm run rebuild
  • npm run start