how to read enum value from dll using node ffi

331 Views Asked by At

I have a dll file that i want to wrap into a JS interface, im using node-ffi-napi library in order to do this.

calling functions works however i have functions that use enum values defined in the dll and i dont know their integer corresponding value.

is there a way to define a variable in the JS function that will correspond to the enum in the dll using node-ffi so that i will pass that value without assigning a numeric value myself?

something like let jsEnum=ffi.loadVar(ENUM)?

1

There are 1 best solutions below

0
Rainb On

Just use type int, you have to use the numerical values.