Skip to content

A sample showing how to run VBScript, JScript snippets from C++

Notifications You must be signed in to change notification settings

stephenquan/RunScriptDemo

Repository files navigation

RunScriptDemo

I've put together a "Hello World" IActiveScript C++ ATL console application that:

  • Define CSimpleScriptSite class
    • Implement IActiveScriptSite interface (mandatory)
    • Implement IActiveScriptSiteWindow interface (optional)
    • Minimum implementation with most functions implemented with a dummy stub
    • Has no error handling. Consult MSDN IActiveScriptError.
  • Use CoCreateInstance a new IActiveSite object
    • Create instances of both VBScript and JScript
    • Link the IActiveSite to IActiveScriptSite using IActiveSite::SetScriptSite
    • Call QueryInterface to get an IActiveScriptParse interface
    • Use IActiveScriptParse to execute VBScript or JScript code
  • The sample:
    • Evaluates an expression in JScript
    • Evaluates an expression in VBScript
    • Runs a command in VBScript

References:

About

A sample showing how to run VBScript, JScript snippets from C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published