25

I have a windows c++ DLL. It provides some functions like add(1,2). But I don't have the source code for this DLL, is it possible call functions in this DLL through nodejs, I mean, through web side and http. If it possible, what should I do?

Zexi Li
  • 392
  • 1
  • 4
  • 11
  • 1
    Maybe you can find some useful infor from this question [http://stackoverflow.com/questions/9629677/how-can-i-use-a-c-library-from-node-js](http://stackoverflow.com/questions/9629677/how-can-i-use-a-c-library-from-node-js) – zangw May 27 '15 at 10:34
  • 1
    Possible duplicate of [How can I use a C++ library from node.js?](http://stackoverflow.com/questions/9629677/how-can-i-use-a-c-library-from-node-js) – Software Engineer Feb 21 '17 at 09:49

1 Answers1

1

Did you check out the ffi nodejs library? https://github.com/node-ffi/node-ffi

var ffi = require('ffi');

var libm = ffi.Library('libm', {
  'ceil': [ 'double', [ 'double' ] ]
});
libm.ceil(1.5); // 2