views:

196

answers:

1

Hey,

Im using the xulrunner example application and im trying to work out how to call into c++ code from javascript. I have googled and the best i came up with was to use nsIDOMEventListener interface but have no idea how.

Any ideas?

+1  A: 

What C++ code, your code? That's typically done by creating an XPCOM component in C++.

In the most recent builds (1.9.2, I believe) js-ctypes library is included, which is a simple way to call C functions from JS from a DLL and is similar to ctypes in python and others.

Nickolay
Can this be done with out making a new dll? I would like to do it via the xulrunner interface.
Lodle
I already said what can be done. Your only other option other than creating an XPCOM components is making jsctypes work (possibly by using a new XULRunner) and using it.
Nickolay