Using visual-studio: unable to properly register x64 COM dll on windows 7 x64 on newest questions tagged visual-studio – Stack Overflow

I have a C++ ATL COM DLL that was originally built for x86, dll is being consumed by .NET 4.0 app built for x86, everything works fine.

After recompiling the COM dll for x64, and then registering it using c:\windows\system32\regsvr32 (after un-reg the x86 dll), I’m unable to see the COM DLL in Visual Studio Add Reference window, I exported the reg keys for HKCR and HKLM\Softwares with the x64 and then x86 version of the dll registered, and no keys are missing, the respective keys are pointing to the correct dll location.

Additionally, after registering x64 dll, I am able to add reference to dll by navigating to the folder where file is, and selecting it, but it still fails to execute (.net assembly is set to x64) with following error

System.Runtime.InteropServices.COMException (0×80040154): Retrieving
the COM class factory for component with CLSID
{00000000-0000-0000-0000-A797AD238051} failed due to the followi ng
error: 80040154 Class not registered (Exception from HRESULT:
0×80040154 (REGDB_E_CLASS NOTREG)). at
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolea n noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurity Check) at
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boo lean fillCache) at
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
Boolean skipVisibil ityChecks, Boolean skipCheckThis, Boolean
fillCache) at System.Activator.CreateInstance(Type type, Boolean
nonPublic)

I’ve spent considerable amount of time searching online, but haven’t found anything remotely close, anyone seen anything like this, or any debugging tool I can perhaps use?

I don’t own the dll by the way, the person that owns it, can see the x64 dll once built on the machine, but have tried on 2 other machines, and it didn’t work on either one.

See Answers


source: http://stackoverflow.com/questions/11442796/unable-to-properly-register-x64-com-dll-on-windows-7-x64
Using visual-studio: using-visual-studio



online applications demo