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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Playing wavs in c#(extremely noob question))

  • 15-11-2004 1: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,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, Registered Users 2 Posts: 2,523 ✭✭✭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,523 ✭✭✭optiplexgx270


    did ya get it working so?


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