Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Using html+js as frontend for simple dll

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading