-
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?
-
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?
-
Are you specifying the full path or just "theMidiFile.mid"? Might be a problem with some function calls changing the directory...
-
"sounds/theMidiFile.mid" and that's where its located. I just tried specifying the full path and it works that way.
-
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 :cool: 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?).
-
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
}
-
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 :D 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 :eek: