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
put the dll in system32 or syswow32 directory, and use appropriate regsvr32 to register it. wiered that even though it gave failed to register error, I rebooted my WIN 7 64 AND my vb app loaded the dll just fine!!
If problem not resolved, when using SysWoW64 version of regsvr32, make sure all library dependencies have same archetecture. For example, when
regsvr32 lib_x86.dll fails to register library, and
%SystemRoot%\SysWow64\regsvr32 lib_x86 also fails, try to load lib_x86 to Dependency Walker application to see whole list of dependencies. If any item have 64-bit archetecture, here is the reason, why regsvr32 fails to load 32-bit library.
To register a comm .dll or .ocx on Windows 7 32-bit, do the following:
Copy .dll or .ocx to c:\windows\system32
Type cmd in Run menu, it will search cmd.exe, right click and click Run as Administrator
It will show a prompt at c:\windows\system32
Type
regsvr32 ocxname.ocx to register .ocx
or
type regsvr32 dllname.dll to register .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