Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to call javascript method from c++ #127

Open
cvinodhkumar77 opened this issue Jan 7, 2019 · 1 comment
Open

Is there any way to call javascript method from c++ #127

cvinodhkumar77 opened this issue Jan 7, 2019 · 1 comment

Comments

@cvinodhkumar77
Copy link

Is there any way to call a function from c++. The control should go as below:
This is for a scanner device
js:
function jsMethod1(){
calls c++ MethodA();
}
function jsMethod2(){
// some stuff
}

c++:
MethodA(){
// This will initialize the device
}

//This will be called whenever Barcode scanned
MethodB{
//should call jsMethod2
}

The reason why I'm not calling the MethodB directly is, this call will be triggered automatically by the library and there are 4 methods that are triggered similar way by the library. So basically I want to trigger a call from c++ whenever barcode scan happens which I want to sense from the js

Thanks

@wzhouwzhou
Copy link

Hello,

This link contains an example of calling JS functions from C++; if you're in search of class-based instance methods, then perhaps reading this section of the readme might help. Judging by the repository statistics, amount of open issues, and general rule of thumb, expecting spoonfeed from the repository maintainers does not seem to me reasonable, so at the very least the readme is easy to follow, the documentation is extensive, and the examples are nice.

William

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants