?
Solved

Embed JavaScript in C++ app

Posted on 1997-06-27
4
Medium Priority
?
398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
Suggested Courses

770 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