TooTallNate / ref

Turn Buffer instances into "pointers"
http://tootallnate.github.com/ref
454 stars 142 forks source link

I have problem with DWORD types #116

Closed ozguracar closed 5 years ago

ozguracar commented 5 years ago

Dll wants DWORD from me. When I sent parameters I can not connect to device. Can you analyze my codes and tell me what's wrong?

`var ffi = require('ffi') var ref = require('ref')

var int = ref.types.int var dword = ref.types.uint32 var bool = ref.types.bool var word = ref.types.uint16

var sdk = ffi.Library('./_RC_UTIL.dll', { 'Show_Error_Message': [int, [int]], 'Get_Status': [int, [dword,dword,dword,word,bool]], })

var deviceSerial=210551803 var devicePass=2724104912 var deviceIp=3232235816 // 192.168.1.40 Convert Decimal var devicePort= 5522

/ int __Get_Status ( DWORD deviceSerialNo, DWORD password, DWORD ip, WORD port, bool task, void status ) */

sdk.Show_Error_Message(sdk.Get_Status( deviceSerial, devicePass, deviceIp, devicePort, true))`