Hmm....I think I need to stick with Emscripten. The basic usage of what I 
am trying to do is make an XMLHttpRequest by calling Javascript code from 
C++ and then having the Javascript callback to the C++ code. I know there 
is a wget function in Emscripten, but you can't set any headers with it. 
Since I'm making a REST API client that is quite crippling. I've been doing 
some reading and I think lambdas might help out here, but there aren't any 
full examples. I saw Chad's discussion here 
<https://chadaustin.me/2014/06/emscripten-callbacks-and-c11-lambdas/>, but 
I'm still not clear on it.

My initial thought was to instantiate an "HTTPClient" class in C++ and 
create several lambda functions (with capture by value) inside the calling 
member method that could be passed as callbacks. So far I cannot get that 
to compile.

I do like the ease of use with nbind though. I see you have a "
nbind::cbOutput" type over there. Sounds like what I am trying to do. How 
much does nbind increase the size of the output JS though?

On Tuesday, June 21, 2016 at 9:00:14 PM UTC-4, PSN wrote:
>
> I would like to instantiate an object in C++ and have a Javascript onload 
> function callback to one of the instantiated objects methods. The plan 
> would be to call the Javascript code from C++ and then have the Javascript 
> callback to the object function. What is the best way to do this? I've been 
> looking at EMBind, but I don't want to instantiate in Javascript. Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to