locked
Why I can not use flag:MCI_OPEN_SHAREABLE? RRS feed

  • Question

  • Following is my code for openning a wave:
      MCI_OPEN_PARMS mciOpenParams;
      mciOpenParams.lpstrDeviceType =_T("waveaudio");
      mciOpenParams.dwCallback = (DWORD_PTR) (_hWnd);
      mciOpenParams.lpstrElementName = _T("audio.wav"); // example
      DWORD dwCommandFlags = MCI_OPEN_SHAREABLE | 

                                  MCI_OPEN_ELEMENT | MCI_OPEN_TYPE | MCI_WAIT;

      mciSendCommand(NULL, MCI_OPEN, dwCommandFlags, (DWORD_PTR)  (&mciOpenParams));

      When running, it reports an error: The using MCI device can not support the specified command with error code is 274(MCIERR_UNSUPPORTED_FUNCTION), but when I drop the flag: MCI_OPEN_SHAREABLE,  the program runs normally.
    So, what's wrong about my code?

    Monday, May 14, 2007 7:00 AM

Answers

  • http://msdn2.microsoft.com/en-us/library/ms712795.aspx:

     

    "if a device supports only one open instance, the open command will fail if you specify the shareable flag."

     

     

    ----------------------------------------------------------------------------
      Mike Wasson, SDK Documentation
      This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2007 Microsoft Corporation. All rights reserved.

     

    Monday, May 14, 2007 7:03 PM

All replies

  • http://msdn2.microsoft.com/en-us/library/ms712795.aspx:

     

    "if a device supports only one open instance, the open command will fail if you specify the shareable flag."

     

     

    ----------------------------------------------------------------------------
      Mike Wasson, SDK Documentation
      This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2007 Microsoft Corporation. All rights reserved.

     

    Monday, May 14, 2007 7:03 PM
  • Thank you.

    That is to say, it is not possible for playing two wave files at the same time using the "waveaudio" written by MCI functions?

    Tuesday, May 15, 2007 11:05 AM