-
playsound2
i create a pda os project.
and add a subproject which play sound under this os project.
Now i can successfully build it.
I place my wave file in the release directory.
and use windows ce command prompt to run my subproject
but it has no response, there is no sound comes out.
i cannot figure out what's wrong with it.
please help. thank you!
My subporject code is in the following
Code:
#include <windows.h>
#include <mmsystem.h>
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPreInstance,
LPWSTR lpCmdLine,
int nShowCmd)
{
PlaySound(L"release\\test16bit.wav", NULL, SND_FILENAME);
return 0;
}
-
http://msdn.microsoft.com/en-us/library/ms712879.aspx
1. It returns an error status, use it.
2. L"" is all very well if you always assume wide chars. Using the TEXT() macro would be much better.
3. Popup a message box showing you what the current working directory is.
release\test16bit.wav may be fine if you run it from your IDE, but if you just run the executable from explorer, it's probably just .\test16bit.wav