playsound2

This is a discussion on playsound2 within the C++ Programming forums, part of the General Programming Boards category; i create a pda os project. and add a subproject which play sound under this os project. Now i can ...

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    14

    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;
    }

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,546
    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
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21