Search code examples
c#asp-classicdllregistration

wrap 32 bit dll for 64 bit operating system to work with regsvr32.exe


We are currently transferring our websites from Windows 2003 (32-bit) to Windows 2008 (64-bit) and have hit a problem.

One of our website use the payment gateway HSBC CPI which requires a DLL to be registered(regsvr32.exe), this DLL is then used inside a classic asp website. The problem is the DLL is a 32-bit DLL and so it will not register with the the Windows 2008 operating system.

Is there a way we can wrap this 32 bit dll in a c#.net project so that it's methods are exposed and can be registerd with the OS?

Any help would be very much appreciated.


Solution

  • You can register the DLL with regsvr32.exe from the C:\Windows\SysWOW64 folder.

    However since you can't mix 64/32bit code you'd have to create a C# service running in x86 (see the project properties, platform target) that you can then use from your x64 web app via WCF.

    An easier option would be to ask HSBC for a x64 dll.