Calling a VB Activex DLL method from C# (NET 1.1 - 2003)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I build a project, I get this error:
Argument '1': cannot convert from 'double[]' to 'ref System.Array'

It is about a VB Activex DLL method that I am trying to call (using
System.Runtime.InteropServices).
Many arguments are arrays of double type, and for each one of them I get
that same error message.
I suppose I missed some pieces here.
Very grateful for some help.
 
When I build a project, I get this error:
Argument '1': cannot convert from 'double[]' to 'ref System.Array'

Call it like this

Array tmp = yourDoubleArray;
yourAxObj.SomeMethod(ref tmp);

You may want to use Tlbimp.exe to generate new interop assemblies with
strongly typed array parameters instead.


Mattias
 
Thanks Mattias,
your suggestion worked just fine.
Thanks again
--
Carlot


Mattias Sjögren said:
When I build a project, I get this error:
Argument '1': cannot convert from 'double[]' to 'ref System.Array'

Call it like this

Array tmp = yourDoubleArray;
yourAxObj.SomeMethod(ref tmp);

You may want to use Tlbimp.exe to generate new interop assemblies with
strongly typed array parameters instead.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top