简体   繁体   English

连接 C++ 和 Node JS

[英]Connecting C++ and Node JS

I have been working on a project where I am interacting with a 3D camera(on a single machine) through its SDK written in C++.我一直在从事一个项目,在该项目中我通过用 C++ 编写的 SDK 与 3D 相机(在一台机器上)进行交互。 The extent of my knowledge in that language is just as good as what a basic crash course could teach.我在该语言方面的知识范围与基本速成课程可以教授的知识一样好。 I need to provide an interface(web) which shows the camera preview from the SDK and when the capture image is clicked, I need to capture an Image using the SDK with a specified filename and path.我需要提供一个界面(web),它显示来自 SDK 的相机预览,当单击捕获图像时,我需要使用具有指定文件名和路径的 SDK 捕获图像。 The approaches I thought of are:我想到的方法是:

  1. Using NodeJS exec to capture images the compiled version(exe) of my program in C++.使用 NodeJS exec 在 C++ 中捕获我的程序的编译版本(exe)的图像。 I am communicating the filepath and using json.我正在传达文件路径并使用 json。
  2. I could learn and use C++ CGI to simply control C++ SDK stuff.我可以学习和使用 C++ CGI 来简单地控制 C++ SDK 的东西。

Any help/suggestions would be greatly appreciated.任何帮助/建议将不胜感激。 Thanks in advance.提前致谢。

You can use one of the C++ CGI libraries out there but, as easy as they are to use, just calling an executable seems easier and cleaner.您可以使用其中一个 C++ CGI 库,但是,尽管它们易于使用,但只需调用可执行文件似乎更容易、更清晰。 I think the scanner should come with a bundled tool to drive it, doesn't it?我认为扫描仪应该附带一个驱动它的捆绑工具,不是吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM