Any way to use HTML as an interface to a C/C++ program?

前端 未结 7 1688
旧时难觅i
旧时难觅i 2020-12-11 01:51

I\'m developing a product that is interfaced over USB. I want to write a control app for it, but I cannot program a GUI for poo, so I came up with the idea of using a web pa

7条回答
  •  情深已故
    2020-12-11 02:32

    Unless you write a browser plugin (not very portable), a browser viewing a web page can't just call functions in your C++ program.

    If you're going to control a device from a browser, basically your C++ program needs to incorporate a web server. So, when a link or a button is clicked, the C++ program will receive a connection on a socket it's listening to, and can do whatever.

    That's a perfectly respectable thing to learn to do (probably using some third-party libraries to help with the web server aspect), but so is learning to write a GUI app, and the latter is more directly to the point here ;-)

    Certainly Java can do the same thing. You can even run PHP from the command line and implement your server in PHP, although that's sort of inside out from the way PHP is normally used.

提交回复
热议问题