Link to home
Start Free TrialLog in
Avatar of ssullivan
ssullivan

asked on

Embed JavaScript in C++ app

I need an embedded script language in a large VC++/MFC
application, so users can control the app by writing
in script.  How do I set up the linkage for C++ to pass
parameters to JavaScript and for Javascript to pass
parameters to the C++ routines it calls?
Avatar of icd
icd

Is javascript the language of choice? It may be a good choice if the application you are writing is a browser since Javascript functions are highly specific to this environment but I have doubts that it is useful as a general purpose language.

Java might be a better language (although it is not really a script language).

My personal choice would be perl which now has a number of options including being compiled, having links to C++ and being able to call it from perl.

Although I agree with icd, as a possible answer to your question you could use a combination of applets using JNI and the Live Connect type communication between JS and applets. (This type of communication is available in both MSIE and Netscape, and I belive under Hot Java as well).

Would you be intrested in a more detailed explanation?
For an application dependent on VC++/MFC, the language of chice would be some version of Visual Basic; alternatively look at IBM's REXX.
ASKER CERTIFIED SOLUTION
Avatar of garik
garik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial