在 Win2008 R2 上初始化 NullRender 失败,错误 REGDB_E_CLASSNOTREG

Initialize NullRender failed with error REGDB_E_CLASSNOTREG on Win2008 R2

我的 DirectShow 应用程序在 Win7 上运行。当我将它切换到 Win2008 R2 服务器时,它无法初始化 NullRender 过滤器,错误代码为 -2147221164(即 0x80040154 REGDB_E_CLASSNOTREG "Class not registered")。

HRESULT CDirectShowGraph::AddFilterToGraph(CComPtr<IBaseFilter>& spFilter, GUID filterGuid, LPCWSTR filterName)
    {   
        HRESULT hr = S_OK;   

    //Create the filter
    hr = spFilter.CoCreateInstance(filterGuid);

    if (FAILED(hr))
    {       
        CDirectShowGraph::Msg(TEXT("[CDirectShowGraph::AddFilterToGraph] Failed to initialize filter \"%s\" hr=0x%x"), filterName, hr);
        return hr;
    }

    //Add the filter to the graph
    if (FAILED(hr = m_spGraph->AddFilter(spFilter, filterName)))
    {
        CDirectShowGraph::Msg(TEXT("[CDirectShowGraph::AddFilterToGraph] Adding filter failed \"%s\" hr=0x%x"), filterName, hr);
        return hr;
    }
    return hr;
}

...

m_DirectShowGraph.AddFilterToGraph( m_spNullRenderer, CLSID_NullRenderer, L"NullRender")

我也试过重新安装 Windows SDK。

当我展开 DirectShow 过滤器节点时,甚至 GraphEdit 也会崩溃。我尝试了 DirectShowFilterManager (http://www.softella.com/dsfm/index.en.htm),它也没有在列表中显示 NullRender。但是,在 Win7 上出现了 NullRender。

Microsoft 从 Win Server 2008 中移除了 Null Renderer(连同其他过滤器,例如 Sample Grabber - 全部由 qedit.dll 托管)。您需要寻找替代品,例如,可以是旧平台 SDK 之一中的类似 filter/sample。

另请参阅:

  • Missing 'qedit.dll' in Windows Server 2008?
  • Null Renderer not in graphedit