Skip to content

zpm683/electron-call-dll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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