I want to have Visual Basic scripting support in my Windows application made in VC++. Lemme first make myself a little clear.
Currently i''m working on a program using C++ but i need to evaluate few mathematical equations at run-time. So a friend of mine suggested me to add Visual Basic Scripting support in my application. I tried with this control called "Visual Basic Scripting" n using the class called "CScriptControl" but it doesn''t work.... maybe i am making mistakes somewhere.
Could anyone plz help me out
There is an article in MSDN by Don Box (an author that writes many books about COM programming) that tells you how to add ActiveScripting to your application. Basically, you need to implement the IActiveScriptSite interface and then make a few COM calls to intialize your scripting engine of choice.
You can use any scripting language that supports the IActiveScript and/or IActiveScriptParse interfaces once you have this setup. Microsoft supplies two scripting engines, java-script and VBScript.
You can do lots of things with ActiveScripting, but if you just need to evaluate simple expressions you just need to call a few functions such as IActiveScriptParse's function ParseScriptText.
You can look this all up on MSDN. Hopefully, this will help you out if you know a little about COM programming. If not, maybe I'll write a tutorial someday to explain it more thoroughly. It is powerful, but a little complicated.
Edited by - jaxson on September 27, 2001 11:52:39 PM