Message Boards Message Boards

0
|
1912 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to pass a list of properties as a Variant data type in NetLink/COM?

Posted 10 years ago

Hello,

I have created a COM object using NetLink to interface with another program. It works well except when I try to use methods that take an array of Variant values as argument. The method definition in VB looks like this:

Public Function MyMethod( _
   ByVal AttrIDs As Variant _
) As Variant 

An example in VB of how to use this method is as follows.

object.MyMethod(Array("Prop1", "Prop2")) 

How can I call this method in Mathematica? I tried it like this but get the following error.

object@MyMethod[{"Prop1","Prop2"}]

"A .NET exception occurred: \
"System.Reflection.TargetInvocationException: Exception has been \
thrown by the target of an invocation. ---> \
System.Runtime.InteropServices.COMException: \
CComBaseContainer::GetMultipleAttributes failed "

Thanks!

Rafael

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract