Thread: mci cannot find file

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    380

    mci cannot find file

    I have my space invader clone use MCI to play midi files. When the game loads I get an error stating it can't find the file to play. I have checked and the midi file is in the correct path. This happens on one of the two machines that it has been tested on. Why does this occur and how to fix it?
    Don't you dare hit me on the head, you know I'm not normal.
    A Stooge Site
    Green Frog Software

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    Ok, I have gone through and commented everything out down to the bare bones and still can't find the cause. Does the music work for anyone else?
    Don't you dare hit me on the head, you know I'm not normal.
    A Stooge Site
    Green Frog Software

  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Are you specifying the full path or just "theMidiFile.mid"? Might be a problem with some function calls changing the directory...
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    "sounds/theMidiFile.mid" and that's where its located. I just tried specifying the full path and it works that way.
    Don't you dare hit me on the head, you know I'm not normal.
    A Stooge Site
    Green Frog Software

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Cool, it's great that it works Just for curiosity's sake though, you could try creating a file called "whereisthisfile.txt" without specifying a path, then see where it turns up on your computer If it doesn't end up in the program folder, then you can probably be 99% sure that your problem is the path being changed (or maybe it just doesn't get set to your program folder in the first place?).
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #6
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    Does MessageBox change the directory? If I comment it out the midi file is found on both computers.

    Code:
    if(MessageBox(NULL, "Click Yes to go to full screen (Recommended)", "Options", MB_YESNO | MB_ICONQUESTION) == IDNO)
       {
       dwStyle = WS_BORDER | WS_SYSMENU;   // If we don't want full screen, open a simple window
       }
    else   // If we chose YES
       {
       bFullScreen = TRUE;   // Set our boolean to TRUE, we wanted fullscreen
       // This is the style that we need our window to have in order to be windowless fullscreen
       dwStyle = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
       ChangeToFullScreen(WINDOW_WIDTH, WINDOW_HEIGHT);   
       // This changes our screen to full screen with our desired resolution
       }
    Last edited by lambs4; 09-08-2003 at 04:38 PM.
    Don't you dare hit me on the head, you know I'm not normal.
    A Stooge Site
    Green Frog Software

  7. #7
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Heh, well, I doubt it. Perhaps there are some functions that only get called when you're in fullscreen mode or something?

    By now, I'm just wildly guessing I could very well be wrong about a function changing the path to begin with, since as you said it works on one computer but not on both
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  2. #include header files or .cpp files?
    By DoctorX in forum C++ Programming
    Replies: 3
    Last Post: 12-23-2006, 12:21 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  5. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM