继续调查
embedded WindowsMediaPlayer problem
,我正在尝试通过DirectShow进程内服务器进行简单的文件播放:
::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();
有趣的是,这在我测试的两个系统(windows xp 32&x64)上都运行得很好。
但是在我的实际用例中,它失败了,一个基于npapi的浏览器插件,即加载到firefox/chrome/opera中的dll。
有人知道这里会出什么问题吗?
或者有什么想法可以尝试?
更新:
也被问到
Microsoft forums
.
小精灵:
IGraphBuilder::AddSourceFilter(path,path,&base)
以下注册表调用已失败(如进程监视器中所示):
"RegOpenKey","HKCU\Software\Classes\c","NAME NOT FOUND","Desired Access: Query Value, Maximum Allowed"
"RegOpenKey","HKCU\Software\Classes\Media Type\Extensions\.wav","NAME NOT FOUND","Desired Access: Read"
"RegOpenKey","HKCU\Software\Classes\Media Type","NAME NOT FOUND","Desired Access: Read"