Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Playing wavs in c#(extremely noob question))

Options
  • 15-11-2004 2: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 Posts: 3,317 ✭✭✭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 Posts: 2,497 ✭✭✭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 Posts: 2,497 ✭✭✭optiplexgx270


    did ya get it working so?


  • Advertisement
  • Registered Users Posts: 43,907 ✭✭✭✭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 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