A while ago I ran into a problem while working on a 64bit application. I needed to use a 32bit COM object in my 64bit application but alas that didn’t work.

It seems that by default 32bit COM objects are not usable in a 64bit environment. Trying to access a 32bit COM in a 64bit environment will result in a class not registered error. However, this can be countered using dllhost as a surrogate for the 32bit COM object.

To do this, it involves a small number of simple registry hacks:

  • Locate your COM object GUID under the HKey_Classes_Root\Wow6432Node\CLSID\[GUID]
  • Once located add a new REG_SZ (string) Value. Name should be AppID and 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\
    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.

That’s it, your COM Object should now be accessible from a 64bit environment and can be used like a regular COM Object.

Hope this helped you out. If you have any questions feel free to leave a comment and I will try to help if possible.

Get your free 30-day GFI LanGuard trial

Get immediate results. Identify where you’re vulnerable with your first scan on your first day of a 30-day trial. Take the necessary steps to fix all issues.