I want to use msscript.ocx to call VBScript from C#, and allow the VBScript code to call back to functions in the C# program.
For example, in the following VBScript code, Clicktext
is a custom C# function in the same clsss that is using msscript.ocx to run the VBScript.
For i=0 to i=4
Clicktext("Auto")
Next
The Clicktext function shoud be called 5 times.
Is there any way to do it?
This ComVisible console application with a reference to Interop.MSScriptControl:
pudding:
demonstrates how to call a method of a C# object from VBScript code added to a MSScriptControl.