Passing strongly typed arguments in .NET COM interop
I have two .NET classes exposed via COM interop - let's say Foo and Bar, and I need to pass an argument of type Foo to a method defined in Bar. Something like this: [ComVisible(true)] public class Foo { // whatever } [ComVisible(true)] public class Bar { public void Method(Foo fff) { // do something with fff } } When I run the following VBS (using cscript.exe): set foo = CreateObject("TestCSProject.Foo") set bar = CreateObject("TestCSProject.Bar") call bar.Method(foo) I get an error: D:\test.vbs(3, 1) Microsoft VBScript runtime error: Invalid procedure call or argument: 'bar.Method' However,