电子节点js在后端具有c ++类 [英] electron nodejs with c++ class in backend

查看:56
本文介绍了电子节点js在后端具有c ++类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了基本的HTML5网站创建之外,我对Web开发还是相当陌生的,我以某种方式理解了总体结构,但是我仍然无法完全理解,尤其是电子和nodejs。

I am fairly new to web development other than basic HTML5 website creation, I somehow understand the general structure but I still cannot understand fully especially electron and nodejs.

前几天,我打算创建一个Web应用程序,它与所见即所得的文本编辑器相似,但是在浏览器(HTML5 / js)与后端(C ++脚本)之间进行了交流。
我首先尝试的是拥有一个c ++ hello world脚本,该脚本可以从建立在电子上的webapp执行。我可以将.exe作为child_process来运行,但是我无法继续。

The other day I was going to create a webapp, which is similar to wysiwyg text editor but talks in between the browser (HTML5/js) with the backend (c++ script). What I first tried, was to have a c++ hello world script, which can be executed from the webapp built upon electron. I was able to run .exe as child_process but I couldn't get to further.

现在,我对从C / c ++插件中查找内容进行了更深入的研究。 nodejs,但仍在尝试了解。关于nodejs的基本示例似乎并未使我全面了解如何传输数据。

Now, I took myself a bit deeper research for looking into c/c++ addon from nodejs but still trying to understand. The basic examples on the nodejs doesn't seem to give me a full understanding on how to transfer data.

很长一段描述我的身份的情况很抱歉,但是简而言之,这里有一些问题:

I'm sorry for the long paragraph to describe my status but in short, here are some questions:


  1. 谁能给我一个关于如何将Electron / nodejs用作浏览器后端中间件的想法。

  2. 有人有一个简单的示例/ phedo代码,带有用于在nodejs-c ++后端之间进行对话的propoer API吗? nodejs c / c ++插件是唯一的方法吗?

感谢您的阅读!

推荐答案

正如您已经知道的那样,Node.js为您提供了功能通过其C / C ++插件查找。您是否可以拒绝在Node.js API手册中找到的基本回调示例

As you already figured out, Node.js offers the functionality you seek via its C/C++ Addons. Are you able to repoduce the basic callback example found at the Node.js API manual?

这篇关于电子节点js在后端具有c ++类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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