用vc6写了个Activex视频本机ie可以打开,其他机器ie上无法显示,大包成cab也不能解决,
把.cab文件解压后可以在其他机器上手动注册
;inf file for stream.dll
[Version]
Signature="$CHICAGO$"
AdvancedINF=1.0
[Add.Code]
VideoClt.ocx=VideoClt.ocx
msvcp71.dll=msvcp71.dll
Msvcr71.dll=Msvcr71.dll
msvcrt.dll=msvcrt.dll
mfc42.dll=mfc42.dll
HikPlayM4.dll=HikPlayM4.dll
client.dll.dll=client.dll;needed DLL
[msvcp71.dll]
file-win32-x86=thiscab
FileVersion=7.10.3077.0
DestDir=11[msvcrt.dll]
file-win32-x86=thiscab
FileVersion=7.0.2600.2180
DestDir=11[msvcr71.dll]
file-win32-x86=thiscab
FileVersion=7.10.3052.4
DestDir=11
[mfc42.dll]
file-win32-x86=thiscab
FileVersion=6.2.4131.0
DestDir=11[HikPlayM4.dll]
file-win32-x86=thiscab
DestDir=11
[client.dll]
file-win32-x86=thiscab
DestDir=11;hello dll
[VideoClt.ocx]
file-win32-x86=thiscab
clsid={80698D8E-9B0A-424A-AD5E-D9EB77BD642F}
FileVersin=1.0.0.1
DestDir=11
RegisterServer=yes;end of INF file

解决方案 »

  1.   

    http://blog.csdn.net/simbi/archive/2007/10/17/1829016.aspx
      

  2.   

    http://blog.csdn.net/simbi/archive/2007/10/17/1829016.aspx这个代码有些不明白Cannot open include file: 'strsafe.h': No such file or directory
    strsafe.h在哪里区找
      

  3.   

    jacklzw88,# shunruo两位可否加我,我的qq是15366812
      

  4.   

    shunruo:  加上//#include "comcat.h" 
    #include   "objsafe.h"  
    #include  "strsafe.h"后Error 1 error C2373: 'CATID_SafeForScripting' : redefinition; different type modifiers e:\StreamClientOcx\StreamClientOcx.cpp 17 Error 2 error C2373: 'CATID_SafeForInitializing' : redefinition; different type modifiers e:\StreamClientOcx\StreamClientOcx.cpp 19 报错的就是下面这两行
    const CATID CATID_SafeForScripting     =
    {0x7dd95801,0x9882,0x11cf,{0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
    const CATID CATID_SafeForInitializing  =
    {0x7dd95802,0x9882,0x11cf,{0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
      

  5.   

    安全接口加了还是不行!!请各位帮看看.cab有什么问题
    /打包的.inf
    ;inf file for stream.dll
    [Version]
    Signature="$CHICAGO$"
    AdvancedINF=1.0
    [Add.Code]
    ClientVideo.ocx=ClientVideo.ocx
    msvcp60.dll=msvcp60.dll
    msvcp71.dll=msvcp71.dll
    Msvcr71.dll=Msvcr71.dll
    msvcr80.dll=msvcr80.dll
    msvcrt.dll=msvcrt.dll
    mfc42u.dll=mfc42u.dll
    mfc80u.dll=mfc80u.dll
    HikPlayM4.dll=HikPlayM4.dll
    client.dll.dll=client.dll;needed DLL
    [msvcp60.dll]
    file-win32-x86=thiscab
    FileVersion=6,2,3104,0
    RegisterServer=yes 
    DestDir=10[msvcp71.dll]
    file-win32-x86=thiscab
    FileVersion=7,10,3077,0
    RegisterServer=yes 
    DestDir=10[msvcr71.dll]
    file-win32-x86=thiscab
    FileVersion=7,10,3052.4
    RegisterServer=yes 
    DestDir=10[msvcr80.dll]
    file-win32-x86=thiscab
    FileVersion=8,0,50727,42
    RegisterServer=yes 
    DestDir=10[msvcrt.dll]
    file-win32-x86=thiscab
    FileVersion=7,0,2600,2180
    RegisterServer=yes 
    DestDir=10
    [mfc42u.dll]
    file-win32-x86=thiscab
    FileVersion=6,2,8071,0
    RegisterServer=yes 
    DestDir=10[mfc80u.dll]
    file-win32-x86=thiscab
    FileVersion=8,0,50727,42
    RegisterServer=yes 
    DestDir=10
    [HikPlayM4.dll]
    file-win32-x86=thiscab
    DestDir=10
    [client.dll]
    file-win32-x86=thiscab
    DestDir=10;ClientVideo dll
    [ClientVideo.ocx]
    file-win32-x86=thiscab
    clsid={CC18815D-5A52-47D3-9930-581A956CAB63}
    FileVersin=1,0,0,1
    RegisterServer=yes;end of INF file
      

  6.   

    你的stream.dll 在别的机器上能正常工作么?
      

  7.   

    1.我的activex(vc6改成vs2005了)控件叫ClientVideo.ocx
    2.我增加了安全接口后,然后打包成*.cab,如果在别的机器上解包后手动注册
       (regsvr32 xxxxx\xxx\ClientVideo.ocx)IE里面就可以访问了。但是没有安装
      .netsdk的机器则出不来,不知是哪个文件没有找到。
      

  8.   

    在编译机器上,用Depends找到ClientVideo.ocx 用到的库,放到同一目录下拷过来 
      

  9.   

    应该说在其他机器上手动注册能成功,依赖的动态库就表示都存在哈!
    但ClientVideo.ocx当IE提示下载时,点确定后,还是无法呈现出来。
      

  10.   

    感觉现在的主要问题是IE虽然提示下载clientVideo.cab但没有成功,即使成功也没有注册成功。
      

  11.   

    IE6中是不是所有的.cab都需要数字签名
      

  12.   

    CAB及DLL文件需要做数字签名,如果这些都是正式的没问题的话应该是安全接口的问题了.
      

  13.   

    这是我的安全接口,大虾看看有没有问题!!#include "stdafx.h"
    #include "ClientVideo.h"
    #include  "strsafe.h"
    #include "comcat.h" 
    #include   "objsafe.h"  
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #endif
    CClientVideoApp theApp;const GUID CDECL BASED_CODE _tlid =
    { 0x72134F49, 0x3E4B, 0x4087, { 0x99, 0xA7, 0xE2, 0xB3, 0x80, 0x1C, 0xDC, 0x3F } };
    const WORD _wVerMajor = 1;
    const WORD _wVerMinor = 0;/*
    const   CATID   CLSID_SafeItem   =  
      {   0xcc18815d, 0x5a52, 0x47d3, 0x99, 0x30, 0x58, 0x1a, 0x95, 0x6c, 0xab, 0x63};  HRESULT   CreateComponentCategory(CATID   catid,   WCHAR   *catDescription)  
      {  
              ICatRegister   *pcr   =   NULL   ;  
              HRESULT   hr   =   S_OK   ;  
         
              hr   =   CoCreateInstance(CLSID_StdComponentCategoriesMgr,    
                              NULL,   CLSCTX_INPROC_SERVER,   IID_ICatRegister,   (void**)&pcr);  
              if   (FAILED(hr))  
                      return   hr;  
         
              //   Make   sure   the   HKCR\Component   Categories\{..catid...}  
              //   key   is   registered.  
              CATEGORYINFO   catinfo;  
              catinfo.catid   =   catid;  
              catinfo.lcid   =   0x0409   ;   //   english  
              size_t   len;  
              //   Make   sure   the   provided   description   is   not   too   long.  
              //   Only   copy   the   first   127   characters   if   it   is.  
              //   The   second   parameter   of   StringCchLength   is   the   maximum  
              //   number   of   characters   that   may   be   read   into   catDescription.  
              //   There   must   be   room   for   a   NULL-terminator.   The   third   parameter  
              //   contains   the   number   of   characters   excluding   the   NULL-terminator.  
              hr   =   StringCchLength(catDescription,   STRSAFE_MAX_CCH,   &len);  
              if   (SUCCEEDED(hr))  
                      {  
                      if   (len>127)  
                          {  
                              len   =   127;  
                          }  
                      }        
              else  
                      {  
                          //   TODO:   Write   an   error   handler;  
                      }  
              //   The   second   parameter   of   StringCchCopy   is   128   because   you   need    
              //   room   for   a   NULL-terminator.  
              hr   =   StringCchCopy(catinfo.szDescription,   len   +   1,   catDescription);  
              //   Make   sure   the   description   is   null   terminated.  
              catinfo.szDescription[len   +   1]   =   '\0';  
         
              hr   =   pcr->RegisterCategories(1,   &catinfo);  
              pcr->Release();  
         
              return   hr;  
      }  
         
       
         
      HRESULT   RegisterCLSIDInCategory(REFCLSID   clsid,   CATID   catid)  
      {  
      //   Register   your   component   categories   information.  
              ICatRegister   *pcr   =   NULL   ;  
              HRESULT   hr   =   S_OK   ;  
              hr   =   CoCreateInstance(CLSID_StdComponentCategoriesMgr,    
                                      NULL,   CLSCTX_INPROC_SERVER,   IID_ICatRegister,   (void**)&pcr);  
              if   (SUCCEEDED(hr))  
              {  
                    //   Register   this   category   as   being   "implemented"   by   the   class.  
                    CATID   rgcatid[1]   ;  
                    rgcatid[0]   =   catid;  
                    hr   =   pcr->RegisterClassImplCategories(clsid,   1,   rgcatid);  
              }  
         
              if   (pcr   !=   NULL)  
                      pcr->Release();  
                               
              return   hr;  
      }  
         
       
       
      HRESULT   UnRegisterCLSIDInCategory(REFCLSID   clsid,   CATID   catid)  
      {  
              ICatRegister   *pcr   =   NULL   ;  
              HRESULT   hr   =   S_OK   ;  
         
              hr   =   CoCreateInstance(CLSID_StdComponentCategoriesMgr,    
                              NULL,   CLSCTX_INPROC_SERVER,   IID_ICatRegister,   (void**)&pcr);  
              if   (SUCCEEDED(hr))  
              {  
                    //   Unregister   this   category   as   being   "implemented"   by   the   class.  
                    CATID   rgcatid[1]   ;  
                    rgcatid[0]   =   catid;  
                    hr   =   pcr->UnRegisterClassImplCategories(clsid,   1,   rgcatid);  
              }  
         
              if   (pcr   !=   NULL)  
                      pcr->Release();  
         
              return   hr;  
      } */ // CClientVideoApp::InitInstance - DLL initializationBOOL CClientVideoApp::InitInstance()
    {
    BOOL bInit = COleControlModule::InitInstance(); if (bInit)
    {
    // TODO: Add your own module initialization code here.
    } return bInit;
    }// CClientVideoApp::ExitInstance - DLL terminationint CClientVideoApp::ExitInstance()
    {
    // TODO: Add your own module termination code here. return COleControlModule::ExitInstance();
    }// DllRegisterServer - Adds entries to the system registrySTDAPI DllRegisterServer(void)
    {
    //HRESULT   hr;         //   HResult   used   by   Safety   Functions 
    AFX_MANAGE_STATE(_afxModuleAddrThis); if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
    return ResultFromScode(SELFREG_E_TYPELIB); if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
    return ResultFromScode(SELFREG_E_CLASS);//   Mark   the   control   as   safe   for   initializing.  
    /*                                                                                             
              hr   =   CreateComponentCategory(CATID_SafeForInitializing,    
                        L"Controls   safely   initializable   from   persistent   data!");  
              if   (FAILED(hr))  
                  return   hr;  
         
              hr   =   RegisterCLSIDInCategory(CLSID_SafeItem,    
                        CATID_SafeForInitializing);  
              if   (FAILED(hr))  
                      return   hr;  
         
              //   Mark   the   control   as   safe   for   scripting.  
         
              hr   =   CreateComponentCategory(CATID_SafeForScripting,    
                                                                        L"Controls   safely     scriptable!");  
              if   (FAILED(hr))  
                      return   hr;  
         
              hr   =   RegisterCLSIDInCategory(CLSID_SafeItem,    
                                                      CATID_SafeForScripting);  
              if   (FAILED(hr))  
                      return   hr;  
     */      return NOERROR;
    }// DllUnregisterServer - Removes entries from the system registrySTDAPI DllUnregisterServer(void)
    {
    //HRESULT   hr;         //   HResult   used   by   Safety   Functions 
    AFX_MANAGE_STATE(_afxModuleAddrThis); if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
    return ResultFromScode(SELFREG_E_TYPELIB); if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
    return ResultFromScode(SELFREG_E_CLASS);           /*//   Remove   entries   from   the   registry.  
         
              hr=UnRegisterCLSIDInCategory(CLSID_SafeItem,    
                                                CATID_SafeForInitializing);  
              if   (FAILED(hr))  
                  return   hr;  
         
              hr=UnRegisterCLSIDInCategory(CLSID_SafeItem,    
                                                      CATID_SafeForScripting);  
              if   (FAILED(hr))  
                  return   hr;  
    */
    return NOERROR;
    }
      

  14.   

    我是在ie6里面用
    1.ocx需要数字签名?
    2.ocx中需要的.dll文件也需要数字签名?
    打包后.cab也需要数字签名