如何在 Electron App 中调用本地 .dll 文件 [英] How to call local .dll files in Electron App

查看:23
本文介绍了如何在 Electron App 中调用本地 .dll 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了如何将示例 .dll 文件调用到我的 Electron 应用程序中的问题.我的文件夹中有示例 .dll 文件,问题是如何访问我的 sample.dll 文件以及如何调用我的 sample.dll 函数并获得结果.任何教程或步骤请遵循示例代码开始

i have an issue how to call sample .dll files into my Electron App. I have sample .dll files in my folder, the thing is how to access my sample.dll file and how to call my sample.dll function and gets results. Any tutorials or steps to follow please sample code to start

推荐答案

在 Electron 中调用 .dll 与在普通 NodeJS 中调用一个没有什么不同,这意味着你有两个选择,node-ffi本机节点插件,它与您的 .dll 链接并公开 JavaScript API.如果你决定创建一个原生 Node 插件,你需要 构建它目标电子.

Calling into a .dll in Electron is no different to calling into one in plain NodeJS, which means you have two options, node-ffi or a native Node addon that links with your .dll and exposes a JavaScript API. If you decide to create a native Node addon you will need to build it to target Electron.

以下是一些涵盖这些主题的链接:

Here are some links that cover these topics:

这篇关于如何在 Electron App 中调用本地 .dll 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆