Solved

Embed JavaScript in C++ app

Posted on 1997-06-27
4
393 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

734 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