使用node-ffi

问题描述

我想使用node-ffi将简单的javascript对象发送到c ++ dll。 我能够发送内置数据类型,例如int,string,double,但无法弄清楚如何发送对象。

var myobj = ref.types.void 
const add = new ffi.Library("./addDll",{
    "testB": [
        "int",["int","int"]
    ],"createObject": [
        myobj,[myobj]
    ]
});
console.log("===>",add.createObject({"data":"test"})) // this does not work
console.log("===>",add.testB(3,4)) // this works fine

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)