Hi. I need help using a dll function. I've tried a lot of things but could not find the good way to use it correctly.
the function in the dll is define as :
void fft_float (
unsigned NumSamples, /* must be a power of 2 */
int InverseTransform, /* 0=forward FFT, 1=inverse FFT */
float *RealIn, /* array of input's real samples */
float *ImaginaryIn, /* array of input's imag samples */
float *RealOut, /* array of output's reals */
float *ImaginaryOut ); /* array of output's imaginaries */
So I'm trying to use something like this in my module:
Declare Function fft_float Lib "Fft.dll" _
(ByVal NumSamples As Long, _
ByVal InverseTransform As Integer, _
ByRef RealIn As Single, _
ByRef ImagIn As Single, _
ByRef RealOut As Single, _
ByRef ImagOut As Single) As Single()
And something like this to use the function:
FFTArray= fft_float(2048,0, FFTinArrayX, FFTinArrayY, FFToutArrayX, FFToutArrayY)
Where FFTinArrayX, FFTinArrayY, FFToutArrayX, FFToutArrayY are all declare as array of single. But VB always give me an error message about FFTinArrayX causing a type mismatch or Byref argment type mismatch.
Could someone help me ? I don't really understand how to get back an array from the dll.
Thanks a lot
the function in the dll is define as :
void fft_float (
unsigned NumSamples, /* must be a power of 2 */
int InverseTransform, /* 0=forward FFT, 1=inverse FFT */
float *RealIn, /* array of input's real samples */
float *ImaginaryIn, /* array of input's imag samples */
float *RealOut, /* array of output's reals */
float *ImaginaryOut ); /* array of output's imaginaries */
So I'm trying to use something like this in my module:
Declare Function fft_float Lib "Fft.dll" _
(ByVal NumSamples As Long, _
ByVal InverseTransform As Integer, _
ByRef RealIn As Single, _
ByRef ImagIn As Single, _
ByRef RealOut As Single, _
ByRef ImagOut As Single) As Single()
And something like this to use the function:
FFTArray= fft_float(2048,0, FFTinArrayX, FFTinArrayY, FFToutArrayX, FFToutArrayY)
Where FFTinArrayX, FFTinArrayY, FFToutArrayX, FFToutArrayY are all declare as array of single. But VB always give me an error message about FFTinArrayX causing a type mismatch or Byref argment type mismatch.
Could someone help me ? I don't really understand how to get back an array from the dll.
Thanks a lot