mci_close with a cda file
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: mci_close with a cda file

  1. #1
    Join Date
    Mar 2013
    Posts
    13

    mci_close with a cda file

    I can not get the sound to stop playing a cda file with MCI_CLOSE.
    This code works with wav and mpg and avi files.

    LONG WindowProc()
    {
    switch (msg)
    {
    case WM_COMMAND:
    if (wParam == IDC_PLAY)
    {
    //A CDA File
    SendMessage(m_hwMCI,MCIWNDM_OPENA,0,(LPARAM)&chFile);
    SendMessage(m_hwMCI,MCI_SEEK,0,dwStart);
    SendMessage(m_hwMCI,MCIWNDM_PLAYTO,0,dwEnd);
    break;
    }
    if (wParam == IDC_CLOSEMCI)
    {
    SendMessage(m_hwMCI,MCI_CLOSE,0,0);
    break;
    }
    }
    }

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,011

    Re: mci_close with a cda file

    Why don't you use mciSendCommand?
    You could use some additional info if you used it like
    Return value
    Returns zero if successful or an error otherwise. The low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the high-order word of the return value is the driver identifier; otherwise, the high-order word is zero. For a list of possible return values, see MCIERR Return Values.
    To retrieve a text description of return values, pass the return value to the mciGetErrorString function.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center