var ffi = require(’./node_modules/ffi’); var ref = require(’./node_modules/ref’);
var myService = ffi.Library(’./HZSiInterface.dll’, { ‘INIT’: [ ‘int’, [ref.refType(ref.types.char)] ], ‘BUSINESS_HANDLE’:[‘int’,[‘string’,ref.refType(ref.types.char)]] });
var buf = new Buffer(20000); buf.type = ref.types.char; var sFlag = myService.INIT(buf); console.log(buf.toString());
var buf2 = new Buffer(50000); buf2.type = ref.types.char; var sFlag2 = myService.BUSINESS_HANDLE(‘2100^8204010^42^||^12121^1^12123123|20150325170704|^1^’,buf2); console.log(buf2.toString());
返回的控制台显示的:
实际应该返回的值: ^^操作员有未签退的业务周期号为:##20150325110816-8204-00000042-8351##,HIS系统传入的业务周期号错误!^返回值:0,错误句柄值:0x6d80000,FILE:DynamicRequest\EapagentEx.cpp,LINE:221