MadMaxMSCN
Newcomer
Hi everybody,
I have to use MSScriptControl in my Application.
First I added the reference to MSScriptControl, of course.
Then I created some objects and a ScriptControl.
When I try to add the objects to the ScriptControl I get an Exception.
Dim script As New MSScriptControl.ScriptControl
In Button_Click:
dim oTest As New Object
dim btnTest As New Button
script.AddObject("form", Me, True) 'this works
script.AddObject("object", oTest, False) 'works, too
script.AddObject("button", btnTest, False) 'Exception
script.AddObject("otherButton", Me.Button1, False) 'Exception
Why do I get this Exception:
An unhandled exception of type 'System.InvalidCastException' occurred in WindowsApplication2.exe
Additional information: Schnittstelle nicht unterstützt
in English: No such Interface supported
What's wrong?
I have to use MSScriptControl in my Application.
First I added the reference to MSScriptControl, of course.
Then I created some objects and a ScriptControl.
When I try to add the objects to the ScriptControl I get an Exception.
Dim script As New MSScriptControl.ScriptControl
In Button_Click:
dim oTest As New Object
dim btnTest As New Button
script.AddObject("form", Me, True) 'this works
script.AddObject("object", oTest, False) 'works, too
script.AddObject("button", btnTest, False) 'Exception
script.AddObject("otherButton", Me.Button1, False) 'Exception
Why do I get this Exception:
An unhandled exception of type 'System.InvalidCastException' occurred in WindowsApplication2.exe
Additional information: Schnittstelle nicht unterstützt
in English: No such Interface supported
What's wrong?