I have a SDK that will communicate with my Scanner device that is written in C++ language. I need to develop an Electron App that can access the Scanner device. I know there are many libraries available for scanner but I want to use this SDK since it will allow me to access full feature of the device and moreover it is provided by the device manufacturer. So, is there any way to implement this. Please suggest me any idea.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Why does const allow implicit conversion of refere
- How to know full paths to DLL's from .csproj f
相关文章
- node连接远程oracle报错
- vs2017wpf项目引用dll的路径不正确的问题
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- How can make folder with Firebase Cloud Functions
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
You can use the native V8 API for that. You will need to provide a layer over your C++ code and expose it as Javascript entities.
If you're using electron 3 (which in turn uses Node 10), you can use N-API which has great examples on how to wrap a C++ object into a JS object. N-API is stable and supported by Node 10, so it's a pretty good choice over NaN and node-addon-api for the long term.
https://nodejs.org/api/n-api.html
Here's a repository of examples that proves pretty useful. This one specifically is for wrapping C++ objects. https://github.com/nodejs/abi-stable-node-addon-examples/tree/master/6_object_wrap/napi
if there's also a C-style interface you could use node-ffi https://github.com/node-ffi/node-ffi