Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / .NET

Using a 32-bit COM Object from a 64-bit Application

4.25/5 (9 votes)
16 Oct 2011CPOL 73.7K  
How to edit the Registry to allow 64-bit applications to access 32-bit COM objects.

I have an application that I wanted to be 64-bit for some work being done for a third party DLL, but I have a 32-bit DLL that I need to use in the same application.


By modifying the Registry, you can allow a 64-bit app to use a 32-bit COM object.



  1. Locate your COM object GUID under HKey_Classes_Root/Wow6432Node/CLSID.
  2. 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.
  3. Add a new key under HKey_Classes_Root/Wow6432Node/AppID. The new key should be called the same as the COM object GUID.
  4. Under the new key you just added, add a new REG_SZ (string) value, and call it DllSurrogate. Leave the value empty.
  5. 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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)