在win64位下安装MXComponent软件,但它只注册了32位的版本,在Delphi中安装了 该软件的32位activex控件,编成32位的程序使用没有问题。但编成64位的程序,编译能通过,就是运行程序的时候,提示 类没有注册。搞了几天了,都没有搞清楚要怎么弄?
1 能否在64位中重新注册一个32位的activex组件?
2 能否编一个32位的dll调用该activex,然后再由64位程序调用该32位的dll?
请高人指教,谢谢

解决方案 »

  1.   

    32位应用程序只能调用32位的ActiveX
    64位应用程序只能调用64位的ActiveX
      

  2.   

    ActiveX/OCX是可以32/64位互操作的,普通DLLs不行。
      

  3.   

    ActiveX与应用程序是在同一个进程里面。如果其中一个使用32bit地址空间,另外一个可以使用64bit地址空间?
      

  4.   

    你可以试一下:
    https://www.codeproject.com/tips/267554/using-bit-com-object-from-bit-application
    By modifying the Registry, you can allow a 64-bit app to use a 32-bit COM object.    Locate your COM object GUID under HKey_Classes_Root/Wow6432Node/CLSID.
        Once located, add a new REG_SZ (string) value. The name should be AppID and the data should be the same COM object GUID you have just searched for.
        Add a new key under HKey_Classes_Root/Wow6432Node/AppID. The new key should be called the same as the COM object GUID.
        Under the new key you just added, add a new REG_SZ (string) value, and call it DllSurrogate. Leave the value empty.
        Create a new key under HKey_Local_Machine/Software/Classes/AppID, if it doesn't already exist. Again, the new key should be called the same as the COM object's GUID. No values are necessary to be added under this key.
      

  5.   

    64位就得使用64位activex控件,64位向下兼容,只是64位可以执行32位程序。
    纯64位程序,就得使用64位的控件。 
      

  6.   

    对应用程序来说,调用是同样的,ActiveX/OCX本来就不是直接调用,而是通过COM接口调用,接口只是一个指针,实际的方法调用是由系统层面完成的,
    与代理无关。因为COM server支持两种运行模式:in process和out of process,后者就支持32/64位互操作,之所以需要设置一下注册表,是因为win64中实际有两个注册表,一个用于64位应用,另一个用于32位应用,注册64位ActiveX组件时只注册到了64位注册表部分,32位也一样,所以默认情况下64位程序找不到32位ActiveX。理论上来说,所有基于COM规范的二进制接口实现,诸如OLE、OCX(OLE Control Extension)、ActiveX(ActiveX实际只是一个推广名,技术上是OLE Automation Server)都可以实现32/64位互操作,比如实测写一个win64程序,OLE打开word2003正常。
      

  7.   

    普通DLLs之所以不能32/64位互操作,是因为普通DLLs只能in process,在调用者的地址空间中运行。
      

  8.   

    ActiveX/OCX是可以32/64位互操作的,普通DLLs不行。