I have written a C++ function that reads data from a txt file does some calculations and then writes the results to another txt file.
I would like to make this available to my colleagues by giving it a simple frontend.
My idea was the following:
I compiled the C++ code with the function as a dll file. Now I want to create a simple web-based frontend. For this to work the dll function would need to be called by javascript. The dll file itself is located on a protected folder, that is accessible from all my colleagues PCs. The html file would also be stored in a commonly accessible folder (not on the internet).
I googled this and it seems to be very hard to do this, requiring some browser specific plugins/extensions.
I don’t understand why this is. From my understanding all web browsers contain a Javascript Engine which interprets Javascript code at runtime. So all I would need is a javascript library that is able to load a dll which doesn’t seem to exist?
I think am having some basic error / problem of understanding here… Is it even possible to do this? Hope you guys can help.
>Solution :
Firstly, loading a DLL from JavaScript running in a browser is not possible. Browsers cannot access the local file system or execute native code like DLLs directly.
To achieve what you want, you could create a server-side component that wraps your DLL function and exposes it as a web service. You could then create a simple web page that sends data to the web service and displays the results.
Alternatively, you could explore using a technology like WebAssembly, which allows you to run native code (including C++) in the browser.