Run a .dll in C#

  • Thread starter Thread starter Leif
  • Start date Start date
L

Leif

I am trying to reproduce a VB6 application in C#. the VB
program extracts the data froma .wav file and sends it
(or calls, not really sure of the proper terminology) to
a .dll file which then uses the information.

the following VB code seems to accomplish this task but I
am having a hard time finding instructions on similar code
for C#. any assistance (examples, sample code, articles
etc) would be greatly appreciated.

here is the VB code:

Private Declare Sub FFTSingle Lib "C:\FFT.dll"
Alias "fft_float" _
(ByVal NumSamples As Long, ByVal InverseTransform As
Boolean, RealIn As Single, _
ImagIn As Single, RealOut As Single, ImagOut As Single)


the following command is used in a separate event:

FFTSingle 8192, False, RealIn(1), ImagIn(1), RealOut(1),
ImagOut(1)

Thanks for the assistance,
 
Leif,

Try this

using System.Runtime.InteropServices;

---

[DllImport(@"c:\fft.dll", EntryPoint="fft_float")]
static extern void FFTSingle(int NumSamples, bool InverseTransform,
float[] RealIn, float[] ImagIn, float[] RealOut, float[] ImagOut);

---

FFTSingle(8192, false, RealIn, ImagIn, RealOut, ImagOut);



Mattias
 
Back
Top