Thread: How to open a midi in directX

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    173

    How to open a midi in directX

    Hello:
    I've tried to use mciSendString() to open a midi in directX, but it gave me such error message:error LNK2001: unresolved external symbol __imp__mciSendStringA@16
    fatal error LNK1120: 1 unresolved externals

    I don't know why, I've included such DSOUND.LIB AND DSOUND.H, even winmm.dll in my project also, but it didn't work, anyone can figure it out, or anyother ways to work on it.

    Thank you very much
    Don't laugh at me,I am just a SuperNewbie.

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    You can't play midi files with DirectSound, you need to use DirectMusic for midi's. Check out the SDK doc's for how to set it up (it's not the same as setting up the other DX components, you have to initialize COM, etc.). If you need more help check out www.gamedev.net under their DX tutorial section.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    173
    Thanx, so what is that mciSendString() for, I saw someone used this in DirectX? that was quite simple if I can.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Opps read the post properly first
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    142
    hiya, mci*** functiosn are not part of the dx, you could serach for MCI overview on the msdn,


    from msdn,
    The Media Control Interface (MCI) provides standard commands for playing multimedia devices and recording multimedia resource files. These commands are a generic interface to nearly every kind of multimedia device

  6. #6
    Registered User Esss's Avatar
    Join Date
    Aug 2001
    Posts
    133
    Alternatively, you could always read the help.

    "Requirements
    Library: Use Winmm.lib."

    Add

    #pragma comment(lib, "winmm.lib")

    to your source code, or add winmm.lib to your project.
    Ess
    Like a rat in a maze who says,
    "Watch me choose my own direction"
    Are you under the illusion
    The path is winding your way?
    - Rush

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Too many files open?
    By homer_3 in forum C++ Programming
    Replies: 2
    Last Post: 11-11-2008, 10:17 PM
  2. Open Source and Security
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 06-17-2008, 01:23 AM
  3. Open Software License 3.0 Explained
    By laserlight in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 01-08-2008, 08:10 PM
  4. To open or not to open ?
    By darfader in forum C Programming
    Replies: 7
    Last Post: 09-24-2003, 08:14 AM
  5. Ghost in the CD Drive
    By Natase in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 10-12-2001, 05:38 PM