我写了一个activeX,打成cab包以后,放在html的codebase里面,从另一台机器的IE里面打开后,cab己经下载至ie的临时目录下了,但是activeX没有自动注册,会是什么原因

解决方案 »

  1.   

    activex一定要完全支持标准你可以用一个ATL样本,试试看还有activex需要通过.inf进行安装,网上样本很多
      

  2.   

    完全支持标准是什么意思 inf文件我到是写了
      

  3.   

    还有 ,cab的默认释放目录是windows\occache 我怎么没发现这个目录了?
      

  4.   

    需要支持DllRegister...几个接口,你新建一个ATL在里面扩充你的内容,最好这样.
    cab只会放在临时目录,安装后的目录2000以上的系统是在%SystemRoot%\\Downloaded program files目录下
      

  5.   

    我是用MFC 的wizard 生成的ativex.不用是的ATL com那个是不是要把activeX的运行时动态库也给包含进来啊?
      

  6.   

    MFC activex也一样的,如果你没有改什么,那就是你的inf文件有问题了
      

  7.   

    你说的DLLRegisterserver这几个接口 用重写吗?
      

  8.   

    VC生成的不用重写,你用depends看一下你的dll有没有导出这些接口
      

  9.   

    [version]
    signature="$CHICAGO$"
    AdvancedINF=2.0
    [Add.Code]
    ActiveXChat.ocx=ActiveXChat.ocx        mfc42.dll=mfc42.dll   
            msvcrt.dll=msvcrt.dll   
            olepro32.dll=olepro32.dll [ActiveXChat.ocx]
    file-win32-x86=thiscab
    clsid={6D1235E2-BA35-420B-8FB9-E39C81E67D0B}
    RegisterServer=yes
            
    ;   dependent   DLLs   
    [msvcrt.dll]   
    ;   This   is   an   example   of   conditional   hook.   The   hook   only   gets   processed   
    ;   if   msvcrt.dll   of   the   specified   version   is   absent   on   client   machine.   
    FileVersion=4,20,0,6164   
            hook=mfc42installer   
        
    [mfc42.dll]   
            FileVersion=4,2,0,6256   
            hook=mfc42installer   
        
    [olepro32.dll]   
            FileVersion=4,2,0,6068   
            hook=mfc42installer   
        
    [mfc42installer]   
            file-win32-x86=http://activex.microsoft.com/controls/vc/mfc42.cab   
    ;   If   dependent   DLLs   are   packaged   directly   into   the   above   cabinet   file   
    ;   along   with   an   .inf   file,   specify   that   .inf   file   to   run   as   follows:   
    ;InfFile=mfc42.inf   
    ;   The   mfc42.cab   file   actually   contains   a   self   extracting   executable.   
    ;   In   this   case   we   specify   a   run=   command.   
    run=%EXTRACT_DIR%\mfc42.exe