Run a .dll in C#

L

Leif

. Reply (E-mail) Forward (E-mail)

Subject: Run a .dll in C#
From: "Leif" <[email protected]> Sent: 7/21/2003
6:05:01 AM




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

Gabriel Esparza-Romero [MSFT]

Hi

The C# equivalent would be more or less this:

[DllImport("C:\\FFT.dll")]
private static extern void FFTSingle (long NumSamples, bool InverseTransform, IntPtr RealIn, IntPtr ImagIn, ref IntPtr RealOut, ref IntPtr ImagOut);

I'm guessing the direction of the last four parameters as well as the type. You will need to add a using clause for the System.Runtime.InteropServices
namespace.

hope this helps

--------------------
 
L

Leif

thnaks
-----Original Message-----
Hi

The C# equivalent would be more or less this:

[DllImport("C:\\FFT.dll")]
private static extern void FFTSingle (long NumSamples,
bool InverseTransform, IntPtr RealIn, IntPtr ImagIn, ref
IntPtr RealOut, ref IntPtr ImagOut);
I'm guessing the direction of the last four parameters as
well as the type. You will need to add a using clause for
the System.Runtime.InteropServices
namespace.

hope this helps
confers no rights. Use of included script samples are
subject to the terms specified at
 

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