Gabriel H
Gabriel H

Reputation: 1576

how to read enum value from dll using node ffi

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)?

Upvotes: 1

Views: 384

Answers (1)

Rainb
Rainb

Reputation: 2465

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

Upvotes: 0

Related Questions