
Passing VB arrays to a dll written in C
I 'd really really appreciate any help with this stuff.
I mostly write software in C/C++ and I have extremely
limited knowledge when it comes to VB.
I did try Dejanews first before posting. Here's the problem,
I wrote a C Dll,
void mydll(double * array1, double ** array2)
I want to call this from a VB program. It should create these
arrays, and the dll 'll only process them.
In VB I use,
Dim Array1(100) As Double
Dim Array2(10,100) As Double
My questions are,
a) How do I 'Declare' these functions in VB..?
Public Declare Sub mydll Lib "thedll" ( .. ????? )
Should I pass array names only ? Should I use ByVal as Any
or ByRef? Should I use paranthesis after array name?
b) How can I differentiate in two dimensional and single
dimensional array in VB, while I am passing them as argument.
I mean how do I let VB know about that?
c) Can I use user defined type in VB, and then use the equivalent
in C? So maybe I can use array inside a user defined type, and
then pass it 'As Any'.
Thanks a million !!
--
Noman