Search code examples
c#comregistry32bit-64bit

Is there a tool for registering 32 bit COM classes for use by 64bit through the COM surrogate


We have some C# assemblies that can be registered using RegAsm and accessed from VBA using 32bit Excel

If we use 64bit Excel then we need to add registry entries e.g.

[HKEY_CLASSES_ROOT\AppID\{F103997A-4B60-44BB-8935-AC85704A7960}]
"DllSurrogate"=""

[HKEY_CLASSES_ROOT\CLSID\{F103997A-4B60-44BB-8935-AC85704A7960}]
AppID="{F103997A-4B60-44BB-8935-AC85704A7960}"

[HKEY_CLASSES_ROOT\CLSID\{F103997A-4B60-44BB-8935-AC85704A7960}]
AppID="{F103997A-4B60-44BB-8935-AC85704A7960}"

This seems to be enough to make it work, but we wanted to know if there was a tool that can generate the registry entries, and also remove them in the same way as RegAsm register/unregister


Solution

  • There is no tool to generate the COM surrogate entries to enable 64bit Excel to talk to 32bit COM.

    I wrote a simple tool to generate the .reg file and this is used by the installer.

    When our class ids/prog Ids change, a new .reg file is generated