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 reference to this DLL in the project. I try to register it in Command Prompt as Administrator in Windows 7 64 bit, but I get this error:
Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe.
First I put DLL file to windows/system32 folder. Then I open Command Prompt as Administrator. I write regsvr32 huginalpha.dll
and execute this command. But I get the error. what can I do?
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.
For 32 bit DLLS in Windows 64 bit platforms:
c:\windows\sysWOW64\
In the CMD window:
CD c:\windows\sysWOW64\
regsvr32 whatever.dll
You will then be executing the 32-bit regsvr (c:\windows\sysWOW64\regsvr.exe
) on a 32 bit dll
I believe, things have changed now. On My Win 2008 R2 Box, I was able to register a 32 bit dll with a 64 bit regsvr32 as the 64 bit version can detect the target bitness and spawn a new 32 bit regsvr32 from %SYSWOW% folder.
Refer: Registering a 32 bit DLL with 64 bit regsvr32
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 ;)
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