I have come across a scenario in my project, where I am creating a MCI window in order to play some videos, wherein it does not play correctly when there is a filepath passed to it which is more than 128 characters long.
I am creating a new MCIWindow like so:
m_window = MCIWndCreate( _owner, GetModuleHandle(NULL), WS_CHILD|MCIWNDF_NOERRORDLG|MCIWNDF_NOPLAYBAR|MCIWNDF_NOMENU, shortPath.c_str() );
and it will later get played by doing the below:
bool VideoMedia::play()
{
logStream().I() << "[VideoMedia::play] start\n";
if ( MCIWndPlay( m_window ) != 0 )
{
logStream().E() << "VideoMedia::play " << "\n";
}
logStream().I() << "[VideoMedia::play] end\n";
return true;
}
In the case where I am creating the m_window
using a shortPath
with length < 128, everything is working perfectly fine with the media showing and playing. However, with a shortPath
with length > 128, no media is played. Interestingly, in the VideoMedia::play()
function above, the logs indicate that the MCIWndPlay()
call is executing fine, as the error log inside of the if is not seen.
I am wondering if this is just the case that the MCIWnd can not support a long file path, although I have not seen anything in the documentation to suggest this is the case?