I have created simple BHO with ATL using these instructions http://msdn.microsoft.com/en-us/library/bb250489(v=vs.85).aspx. I am creating both 64 bit and 32 bit dll of the dll. The problem happens when I try to to unregistered the 64 bit dll after the 32 bit version using regsvr32, I am getting 0x8002801c error. (If I try vise versa the same problem happens). I have added images to celrify.
I think it has something to do with TypeLib registration because I it does the same thing for the 64 bit and 32 bit with no difference, after registering the 32 bit i have these two keys
HKEY_CLASSES_ROOT\TypeLib{5EA5008F-7766-499D-B4B0-9A671C752333}\1.0\0\win32 default = C:\programming\vswork\testfile\test64atlcom\Debug\test64atlcom.dll
HKEY_CLASSES_ROOT\Wow6432Node\TypeLib{5EA5008F-7766-499D-B4B0-9A671C752333}\1.0\0\win32 default = C:\programming\vswork\testfile\test64atlcom\Debug\test64atlcom.dll
Why does this happens, and how can solve it?
The error code is TYPE_E_REGISTRYACCESS
. A typical problem with VS projects is that default template does not have x64
configuration and it's copying from Win32
does not update target environment in MIDL settings.
x64
build with Win32
would load and run, however it's registration would still COM-register the type library as 32-bit and cause 32/64-bit build collision.
So, you need to make sure that type libraries in Win32
builds target 32-bit, and x64
builds have them target 64-bit environment.
User contributions licensed under CC BY-SA 3.0