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: