Null Pointers etc.
Null Pointers etc.

Reputation: 2194

32-bit DLL "may not compatible" on Server 2008, but works on Server 2003

We have a project that compiles to a 32-bit COM DLL and to a 64-bit COM DLL (the same one from my earlier question). When I register both on my Windows 7 machine, both register successfully. When I register both on a Windows Server 2003 machine, both register successfully.

But when I try to register the DLLs on a Windows Server 2008 R2 standard SP1 machine, the 64-bit DLL registers successfully, but the 32-bit DLL fails with the message (sic):

The module ""%1"" may not compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe.

I don't think a 32-bit DLL can be compatible with WS2003 and Win7 but not WS2008. That makes no sense.

What might be happening?

Upvotes: 22

Views: 80173

Answers (6)

Guish
Guish

Reputation: 5160

Use Process Monitor from SysInternals.

1. Filter by "Process Name" = regsvr32.exe.

Filter

2. Try to register your DLL file from the correct version of regsvr32.exe (the 32-bit version is in the SysWow64 folder)

3. Process Monitor will trace EVERYTHING that is happening on your computer.

4. First start your analysis by eliminating the registry events (for now):

enter image description here

5. You may be able to see which DLL file is found and not found.

Here a (very) partial screenshot of regsvr32.exe of Threed32.ocx where we can see some of the required DLL files:

enter image description here

6. Your work is just starting. From now.

Upvotes: 2

user5364342
user5364342

Reputation: 11

Running the command prompt as administrator fixed my issue.

Upvotes: 1

madurama
madurama

Reputation: 11

I have the same problem, but I resolve it with commands

CD \windows\syswow64 regsvr32 c:\filename. dll

Upvotes: 1

Dan K
Dan K

Reputation: 778

This isn't likely to be the problem in your case, but might be useful for others who find this question by searching on the same error message:

I had a similar problem: a DLL that wouldn't register with either the 32-bit or 64-bit version of RegSvr32. I loaded the DLL the Dependency Walker (depends.exe, http://www.dependencywalker.com/) and got a much more useful message:

Error: At least one file was not a 32-bit or 64-bit Windows module.

Scanning the CPU column in the Module List identified the offending module. (In my case, it said "No DOS or PE signature found. This file is not a valid 32-bit or 64-bit Windows module.")

Moral: The Dependency Walker might give you a more useful error message than RegSvr32.exe.

Upvotes: 6

Rasterman
Rasterman

Reputation: 155

I got it registered by moving the dll to the c:\windows\syswow64\ directory (it wouldn't work in the system32 directory) and then explicitly calling syswow64\regsvr32, eg

c:\windows\syswow64\regsvr32 yourdll.dll

btw it wouldn't work when calling c:\windows\syswow64\regsvr32 c:\windows\syswow64\yourdll.dll

Upvotes: 3

nullforce
nullforce

Reputation: 1161

The version of Regsvr32.exe must match the 32-/64-bitness of the dll you're trying to register. The 64-bit regsvr32 cannot load a 32-bit dll, and vice versa.

You may need explicitly call the 32-bit version of regsrv32 located in %systemroot%\SysWoW64\regsvr32.exe.

From http://support.microsoft.com/kb/249873

Regsvr32.exe is included with Microsoft Internet Explorer 3.0 or later versions, Windows 95 OEM Service Release 2 (OSR2) or later versions, and Windows NT 4.0 Service Pack 5 (SP5) or later versions. Regsvr32.exe is installed in the System (Windows Me/Windows 98/Windows 95) or System32 (Windows NT/Windows XP/Windows Vista/Windows 7) folder.

Note On a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file:

  • The 64-bit version is %systemroot%\System32\regsvr32.exe.
  • The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.

Regsvr32.exe usage RegSvr32.exe has the following command-line options: Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

/u - Unregister server /i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall /n - do not call DllRegisterServer; this option must be used with /i /s – Silent; display no message boxes (added with Windows XP and Windows Vista) When you use Regsvr32.exe, it attempts to load the component and call its DLLSelfRegister function. If this attempt is successful, Regsvr32.exe displays a dialog box that indicates success. If the attempt is unsuccessful, Regsvr32.exe returns an error message. This may include a Win32 error code. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 193625 WinInet error codes (12001 through 12156)

Upvotes: 14

Related Questions