S
Sascha Herpers
Hi,
[I posted this on comp.lang.basic.visual.misc, but nobody answered to
it, so I figured this would be a more c-related question. Maybe you can
help...]
I wrote a c dll with a type library to use it in vb. No problem,
everything works fine.
Now I needed to pass an array of type double to the dll. I defined the
function in the type library like this:
double VBEXPORT aigIGApproximation([in] double intervalCount,
[in] SAFEARRAY(double) lambda_i,
[in] SAFEARRAY(double) alpha_i[], [in] double iMax,
[out] double* gammaValue);
with
#define VBEXPORT __declspec( dllexport ) __stdcall
In the object browser (in VB IDE) this function is shown as this:
Function aigIGApproximation(intervalCount As Double,
lambda_i() As Double, alpha_i() As Double,
iMax As Double, gammaValue As Double) As Double
That /looks/ good, but doesn't work. VB says I would use a incompatible
parameter type.
What am I doing wrong? How do I have to declare the type lib to make the
dll accept my double array within VB?
Any hints?
Sascha
[I posted this on comp.lang.basic.visual.misc, but nobody answered to
it, so I figured this would be a more c-related question. Maybe you can
help...]
I wrote a c dll with a type library to use it in vb. No problem,
everything works fine.
Now I needed to pass an array of type double to the dll. I defined the
function in the type library like this:
double VBEXPORT aigIGApproximation([in] double intervalCount,
[in] SAFEARRAY(double) lambda_i,
[in] SAFEARRAY(double) alpha_i[], [in] double iMax,
[out] double* gammaValue);
with
#define VBEXPORT __declspec( dllexport ) __stdcall
In the object browser (in VB IDE) this function is shown as this:
Function aigIGApproximation(intervalCount As Double,
lambda_i() As Double, alpha_i() As Double,
iMax As Double, gammaValue As Double) As Double
That /looks/ good, but doesn't work. VB says I would use a incompatible
parameter type.
What am I doing wrong? How do I have to declare the type lib to make the
dll accept my double array within VB?
Any hints?
Sascha