象 qq影音,暴风影音,kmplayer 这类的软件,安装之后,windows 自带的播放器还是放不了,说明那些软件的目录下的 .ax 文件没有注册进系统,这是怎么实现的?

解决方案 »

  1.   

    动态加载filter 
      
    function lwGetClassObject(hLib : HMODULE; const CLSID,IID : TGUID; var obj) : HRESULT;var
     lpDllGetClassObject : function(const CLSID, IID: TGUID; var Obj): HResult; stdcall;
     pcf : IClassFactory;
    begin
      Result := E_FAIL;
      if (hLib = 0) then
        Exit;  lpDllGetClassObject := GetProcAddress(hLib, 'DllGetClassObject');
      Result := lpDllGetClassObject(CLSID, IClassFactory, pcf);  if pcf = nil then
       Exit;  Result := pcf.CreateInstance(nil, IID, obj);
      if Pointer(obj) = nil then
       Result := E_FAIL;  pcf := nil;
    end;  //use
      hr := lwGetClassObject(LoadLibrary('CL264dec.ax'),
                            CLISD_CL264Decoder,
                            IID_IBaseFilter,
                            pCL264Decoder);  //IGraphBuilder.AddFilter(pCL264Decoder, 'CL264 Decoder8');