只是为了测试目的,我用delphi创建了一个小的DLL。代码是:
library MyDll;
uses
SysUtils,
Classes,
Vcl.Dialogs;
function DllMessage(const echo: string): string; export;
begin
//ShowMessage('Hello world from a Delphi DLL') ;
Result := 'Echo: ' + echo;
end;
exports DllMessage;
begin
end我只想用这段nodejs代码运行像这样简单的东西:
var ffi = require('ffi');
console.log("1");
var mylib = ffi.Library('MyDll', {'DllMessage': [ 'string', [ 'string' ] ] });
console.log(2");
var outstring = mylib.DllMessage('abc');
console.log("3" + outstring);问题是我在控制台上看到了"1“和"2”,没有看到其他任何东西。请帮帮忙,有什么想法吗?
提前感谢
https://stackoverflow.com/questions/44520948
复制相似问题