Calling method with SAFEARRAY(VARIANT) argument
C#
1
Posts
1
Posters
4
Views
1
Watching
-
I am having trouble calling a method on a COM object that takes a SAFEARRAY of VARIANTS as an argument. This array of values is really an array of strings but when the array is contructed like this: System.Array arr = new System.String[1] {"Some String"} it raises a "System.Runtime.InteropServices.SafeArrayTypeMismatchException" exception. When the array connstructed like this: System.Array arr = new System.Object[1] {"Some String"} it raises a "System.Runtime.InteropServices.COMException" exception saying that a referenced object is not found. The method I am trying to call is ICOMAdminCatalog.InstallMultipleComponents Any suggestions? Tony Cleveland