Continuing investigation on a embedded WindowsMediaPlayer problem, i am trying to do simple file playback via a DirectShow in-process server:
::CoInitializeEx(0, COINIT_MULTITHREADED);
CComPtr<IGraphBuilder> spGraph;
spGraph.CoCreateInstance(CLSID_FilterGraph, 0, CLSCTX_INPROC_SERVER);
CComQIPtr<IMediaControl> spMediaControl(spGraph);
// ... later:
spGraph->RenderFile(L"c:\foo.wav", 0); // fails with VFW_E_BAD_KEY
spMediaControl->Run();
Interestingly, this runs fine on both systems i tested on (Windows XP 32 & x64) when doing it in a stand-alone application.
It however fails in my real use-case, a NPAPI based browser plugin - i.e. a DLL loaded into Firefox/Chrome/Opera.
Does anyone have an idea what could be going wrong here?
Or ideas on what else to try?
Update: also asked on the Microsoft forums.
Update2:
IGraphBuilder::AddSourceFilter(path,path,&base)
already fails with the following registry calls (as seen in process monitor):
"RegOpenKey","HKCUSoftwareClassesc","NAME NOT FOUND","Desired Access: Query Value, Maximum Allowed" "RegOpenKey","HKCUSoftwareClassesMedia TypeExtensions.wav","NAME NOT FOUND","Desired Access: Read" "RegOpenKey","HKCUSoftwareClassesMedia Type","NAME NOT FOUND","Desired Access: Read"