Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using DLL function

Status
Not open for further replies.

Fylom

Programmer
Apr 14, 2002
4
0
0
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top