Here is the code I use to play sounds from resources (snipped from an application and obviously not complete)..
Code:
Stat = PlaySound (BYVAL pResource, hInst, uFlags) ' If a sound was already playing, this returns false but lasterror = %NO_ERROR IF ISTRUE(Stat) THEN ' success on the play INCR J ' next time we play the next sound file ELSE ' either failed or a sound was already playing LastError = GetLastError IF LastError <> %NO_ERROR THEN ' OOPS! Errored out for reason other than a sound already playing! MSGBOX "PlaySoundFailed with error " & STR$(LastError) EXIT DO END IF END IF
------------------
Michael Mattias
Racine WI USA
[email protected]
Leave a comment: