Run a .dll in C#


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,
 
Ad

Advertisements

M

Mattias Sjögren

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top