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
Good news everyone! The Boards.ie Subscription service is live. See here: https://subscriptions.boards.ie/

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,581 ✭✭✭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,581 ✭✭✭optiplexgx270


    did ya get it working so?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 44,868 ✭✭✭✭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