That error means: "the current state of the player does not allow that operation". So I think that the player did not start playback yet when you call put_currentposition (WindowsCE devices are not as fast and powerful as full PCs).. I don't think that's a bug, though.
"Atif" <visitatif[ at ]gmail.com> wrote in message news:1183358969.771789.143740[ at ]k79g2000hse.googlegroups.com...
[Quoted Text] > Hi, > > I have come to a problem that i think is bug in WinCE WMP, I have put > a lot of time in it. > I am developing an applications that is required audio playback and I > am using IWMPPlayer , IWMPSettings and IWMPControls to control this > audio. Every thing is fine. But IWMPControls::put_currentPosition > failes when i use it while starting audio, imediately after put_URL. > put_currentPosition works fine if I use it after playing few seconds > audio. Kindly help me about this, is it a bug or I am missing some > thing. This is the code I am using to start the audio > > #include "wmp.h" > > void StartAudio() > > { > > HRESULT hr; > > CComPtr<IWMPPlayer> spWMPPlayer; > > CComBSTR bstr(TEXT(""\\Storage Card\\EnmacQuran\\QuranAudio\ > \002_01A.mp3")); > > CComPtr<IWMPControls> spWMPControls; > > hr = CoInitializeEx(NULL,0); > > if (SUCCEEDED(hr)) > > { > > hr = spWMPPlayer.CoCreateInstance(__uuidof(WindowsMediaPlayer), 0, > CLSCTX_INPROC_SERVER ); > > } > > if (SUCCEEDED(hr)) > > { > > hr = spWMPPlayer->QueryInterface(__uuidof(IWMPControls), > (void**)&spWMPControls); > > } > > if (SUCCEEDED(hr)) > > { > > spWMPPlayer->put_URL(bstr); // Audio started > > } > > if (SUCCEEDED(hr)) > > { > > spWMPControls->put_currentPosition(100.0); // failed > > } > > else > > { > > CString s; > > s.Format(TEXT("%x"),hr) ; > > MessageBox(0,s,0,0); > > } > > > } > > audio starts playing from start but instruction spWMPControls- >>put_currentPosition(100.0) failes here. It gives error 0xc00d1080, > that seems to be undocumented in MSDN. > > please help me about this matter. > > Regards > > Atif >
|