Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Playing wavs in c#(extremely noob question))

  • 15-11-2004 02:20PM
    #1
    Closed Accounts Posts: 94 ✭✭


    Im a beginner at c# and I was looking for code on the net to play wav files. Every bit of code I found used the code below:

    [DllImport("winmm")]

    When I compile an error occurs on that code. I think (Im probably completely wrong) I might need to get the dll file. I havent a clue how to do this, could someone help me out?


Comments

  • Registered Users, Registered Users 2 Posts: 3,315 ✭✭✭Chalk




  • Closed Accounts Posts: 94 ✭✭weerez


    Thanks for that chalk. Just one more question, How do you import/use that in .net? I have never used .dll files before.


  • Registered Users, Registered Users 2 Posts: 2,591 ✭✭✭optiplexgx270


    if your using visual studio .net 2003 its easy in the solution explorer right click on the project and then click on the add reference. a window opens and you can click on the browse option and find the dll. once this is done you will also need to import(using) the objects in the actual code.


  • Closed Accounts Posts: 94 ✭✭weerez


    Thanks for the help


  • Registered Users, Registered Users 2 Posts: 2,591 ✭✭✭optiplexgx270


    did ya get it working so?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 45,148 ✭✭✭✭Basq


    ..then click on the add reference. a window opens and you can click on the browse option and find the dll...

    See weerez...

    I told ya it was Add Reference... you owe me a Coke!

    :)


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Adding a reference will only work for COM dll's or .NET assemblies. Winmm.dll isn't either hence the use of the DllImport attribute.


Advertisement