Solved

Embed JavaScript in C++ app

Posted on 1997-06-27
4
365 Views
Last Modified: 2008-03-04
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?
0
Comment
Question by:ssullivan
4 Comments
 
LVL 5

Expert Comment

by:icd
ID: 1267832
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.

0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1267833
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?
0
 
LVL 11

Expert Comment

by:alexcohn
ID: 1267834
For an application dependent on VC++/MFC, the language of chice would be some version of Visual Basic; alternatively look at IBM's REXX.
0
 
LVL 3

Accepted Solution

by:
garik earned 100 total points
ID: 1267835
If you're not allergic to Microsoft, there is a smooth commercial solution called ActiveX Scripting; check out
http://www.microsoft.com/JScript/us/techinfo/hosting.htm
- there is all info on licensing and usage.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now