Hi, i found a way how to loop a midi using the api but if you are also using other api functions only the first command will work.
eg you load a form and use the api to loop a midi but by pressing the arrow keys you want to bitblt a moving object using the api but the object wont move while the midi is looping.
The way you loop the midi in the bas you posted is suspect to me. If you run that from a prog that has at least 1 form, the loop won't exit until you actually get an error from mciSendString. When you query MCI for status of something (or work with any other things for that matter), output it written to the string buffer you provide. What the function returns is just an error code depending on what happened for the requested commands and isn't necessarily the info you may have asked for. Also, when you loop your midi, you're hanging your prog up right there, which probably isn't a good idea. And since you mentioned pressing arrow keys to do things, your prog may not be reacting as it's supposed to since part of it is caught in that loop. It's better to set up notification on MCI events and then handle them when they occur. If you do that, most likely your BitBlt() problem will go away since that loop won't be constantly executing.
I'm baaaack... VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too
The aim of this is to allow me to play midi music in the background of a tile based bitblt RPG.
The only trouble is that the program always has errors in when it comes to looping the midi.
The reason i need this is because i plan to use an array of maps each over 100 x 100 tiles, people might spend longer than 3 minuits roaming around trying to solve the built in puzzles.
check out the attatchmet to see if you can help, im begging you!