nodejs:如何通过nodejs调用c ++ DLL函数? [英] nodejs:How to call c++ DLL function through nodejs?

查看:190
本文介绍了nodejs:如何通过nodejs调用c ++ DLL函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows c ++ DLL。它提供了一些功能,如add(1,2)。但是我没有这个DLL的源代码,是否可以通过nodejs调用这个DLL中的函数,我的意思是通过web端和http。如果可能,我应该怎么做?

解决方案

是的,有一些突出的解决方案,使用Nodejs与本机/ C ++



结帐这个node-gyp教程: http://www.benfarrell.com/2013/01/03/c-and-node-js-an-unholy -combination-but-oh-so-right /



或Node-ffi: https://github.com/node-ffi/node-ffi


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?

解决方案

Yes, there are some prominent solutions out there for using Nodejs with native/C++.

Checkout this node-gyp tutorial: http://www.benfarrell.com/2013/01/03/c-and-node-js-an-unholy-combination-but-oh-so-right/

Or Node-ffi: https://github.com/node-ffi/node-ffi

这篇关于nodejs:如何通过nodejs调用c ++ DLL函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆