OLEAutomation Interop with object []

From: Phil Wilson (Phil.Wilson_at_unisys.spamcom)
Date: 08/26/04


Date: Thu, 26 Aug 2004 14:16:19 -0700

There doesn't seem to be an obvious (to me anyway!) way to have an interface
in .NET that passes an object [] such that it can be used by (say) VBScript.
In other words, given a method:

 [ComVisible(true), GuidAttribute("66F12379-0C8F---------- etc")]
 [ClassInterface(ClassInterfaceType.AutoDispatch)]
 [ProgId("blah.blah")]
 public class Class1: IMyInterface
 {
  ..
  public void Connect(object [] initializeData )

 }

What is required (MarshalAs or whatever) is that this kind of script works:

set obj = createobject("blah.blah")
dim parm(2)
parm (1) = "this"
parm(2)="that"

obj.Connect parm

The error is pretty consistent at 0x800A0005 Invalid procedure call or
argument: 'obj.Connect'

Help Welcome, thanks.

-- 
Phil Wilson [MVP Windows Installer]
----


Relevant Pages

  • [OOP] attributes and interface both mandatory
    ... public MyAttribute: Attribute ... public interface MyInterface ... public class class1: MyInteface ... public class class1: MyInterface ...
    (microsoft.public.dotnet.framework)
  • Re: Implementing Interfaces in C#
    ... "Class1 does not implement interface member ABC.DoSomething" ... public interface ABC ... public class Class1: ABC ... > VB.net on the other hand generates a compile error if a method is not ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: (inheritance) problem with generic
    ... > What puzzle me is that all 4 test return false! ... > Any idea why is that and how to find the IList interface from the type? ... Prev by Date: ...
    (microsoft.public.dotnet.framework)
  • (inheritance) problem with generic
    ... What puzzle me is that all 4 test return false! ... Any idea why is that and how to find the IList interface from the type? ... Prev by Date: ...
    (microsoft.public.dotnet.framework)