I have a 32 bit COM component DLL and this DLL is written in Delphi. It\'s a Win32 DLL. I want to use this DLL in my Visual C# project on .NET platform.
I can\'t add
http://onerkaya.blogspot.com/2013/03/register-com-dll-on-windows-64-bit.html
Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
if you try this;
c:\windows\system32\regsvr32.exe < filename >.dll
you can still take this exception. so IIS- pool Advanced settings, Enable 32 bit application : true ;)
Below link saved the day
https://msdn.microsoft.com/en-us/library/ms229076(VS.80).aspx
use the relevant RegSvcs as specified in the above link
c:\Windows\Microsoft. NET\Framework\v4.0.30319\RegSvcs.exe ....\Shared\Your.dll /tlb:Your.tlb
I was getting the error "The module may compatible with this version of windows" for both version of RegSvr32 (32 bit and 64 bit). I was trying to register a DLL that was built for XP (32 bit) in Server 2008 R2 (x64) and none of the Regsr32 resolutions worked for me. However, registering the assembly in the appropriate .Net worked perfect for me. C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
The problem is likely you try to register a 32-bit library with 64-bit version of regsvr32. See this KB article - you need to run regsvr32 from windows\SysWOW64 for 32-bit libraries.
Try to run it at Framework64.
Example:
32 bit
C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe D:\DemoIconOverlaySln\Demo\bin\Debug\HandleOverlayWarning\AsmOverlayIconWarning.dll /codebase
64 bit
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe D:\DemoIconOverlaySln\Demo\bin\Debug\HandleOverlayWarning\AsmOverlayIconWarning.dll /codebase
For 32 bit DLLS in Windows 64 bit platforms:
c:\windows\sysWOW64\In the CMD window:
CD c:\windows\sysWOW64\regsvr32 whatever.dllYou will then be executing the 32-bit regsvr (c:\windows\sysWOW64\regsvr.exe) on a 32 bit dll