I have created a new simple COM object in Visual Studio 2008 using the ATL-wizard. The object has a single class and simple methods. The ATL-wizard did generate .rgs
-files for my class.
When I run regsvr32 Simple.dll
on my XP machine the class is registered, information shows up in HKCR\Simple.SimpleObject
and in HKCR\CLSID\{guid}
as I expect.
However, on my 64bit Windows 7 machine it's not the same. I run regsvr32 as administrator the parts in HKCR\Simple.SimpleObject
show up. But the part in HKCR\CLSID
never gets there. And hence I cannot create new instances. (Being desperate I have tried both regsvr32 in System32 and in SysWOW64, same effect.)
Why dont regsrv32
put data into HKCR\CLSID
?
HKCR is an alias for HKLM\Software\Classes but it doesn't show everything. Look in HKLM\Software\Wow6432Node\Classes\CLSID for the registered {guid}. Which is where c:\system32\syswow64\regsvr32.exe writes them.
You did mention that you already tried that. There's something really wrong with that, you cannot arbitrarily run either version of Regsvr32.exe and get the same DLL registered. A 32-bit DLL cannot be loaded in a 64-bit process. In other words, there's no way for the 64-bit version of Regsvr32.exe to register a 32-bit COM server. And the other way around. Why you didn't get an error message is unguessable from here, the only sane explanation is that you somehow didn't actually run the right version of Regsvr32.
To really debug this, use SysInternals' ProcMon utility. Its trace shows you how the ATL registrar is writing the keys in the registry.
32bit applications and components are getting redirected to a different part of the registry. If you are browsing the registry with the 64bit version of regedit you will not find it at the location you expect.
Therefore your component should register itself in HKEY_CLASSES_ROOT\Wow6432Node\CLSID
.
In this registry path it should be visible to all 32bit applications.
See also:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With