I have code that uses the PlaySound() function like this:

        ::PlaySound( (LPCTSTR)strSound, NULL, SND_FILENAME|SND_ASYNC);

Under WinME and WinXP, this works fine; the sound plays as expected.

Under Win98, it doesn't for some reason. PlaySound() returns FALSE, and
GetLastError() returns 0.

I can confirm that the WAV file exists and is accessible. Just to be sure I
copied the WAV file to C:\, to eliminate any possible non-8.3 filename
issues with illegal characters (not that there ever were any such issues).

I know the sound system is fine, I can double-click the WAV file in question
from Windows Explorer and it plays in Media Player.

I can see that WinMM.DLL is in the Windows\System directory, so no problems
there.

MSDN online differs from my local MSDN only in that it additionally mentions
using PlaySoundW() under Win95/98/ME by using the MSLU. But both say
"Requires Windows 95 or later", so it should all work.

Further info: I tried it on a second machine under Win98. That too failed to
play it. But this time, when I went to play it manually, it complained of
not being able to play that type of WAV file. So maybe it's format?

However, even if this is true, on the first machine Media Player could play
it, so why can't PlaySound()?

Any ideas?

--
Jason Teagle
[EMAIL PROTECTED]



_______________________________________________
msvc mailing list
[EMAIL PROTECTED]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription 
changes, and list archive.

Reply via email to