0

I have a JS/HTML frontend and a C++ backend, all using ATL/WTL.

What I am trying to achieve is to create a bidirectional communication between them both, I already am able to call JS functions from C++ backend but I'm finding troubles when I try to send data from JS frontend.

I'm not trying to use a C++ library to extend functionality of HTML/JS, rather I'm trying to access data and methods of the C++ backend which embeds the HTML/JS windows. It is necessary to achieve bidirectional communication between the existing backend and the desired HTML frontend.

Any ideas?

0

2 Answers 2

0

I think you are meeting the problem " Cross language Client". You can't call directly Js -> C++ , so we need you mid-service like "message broker" or Websockets

JS -> MID-SERVICE -> C++

2 ways you can try

1.You can use ActiveMQ for Client C++.
You need code one module to communicate to ActiveMQ by C++
And use amq_js lib for Javascript . Read more in http://activemq.apache.org/ajax.html

2. Make websockets using C++;
And make connection from front-end side .

Hope it helps you.

Sign up to request clarification or add additional context in comments.

Comments

0

I would use Ajax on frontend, then use the proper function on backend.

Check this way: Ajax on JQuery

On JS, get example:

$.get(page, function(data) {
            // Do whatever u want with the data received. (JSON, HTML, ETC)
        });

Do not forget to import jquery:

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
</head>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.