in reply to Perl Version and Win32::OLE

But I have done this due diligence and assure you the dll is registered. This is why I believe the issue is related to the perl versions and their respective behaviors through the Win32::OLE module.

You're wrong. Error 0x80040154: Class Not Registered

Replies are listed 'Best First'.
Re^2: Perl Version and Win32::OLE
by bbrownlee (Initiate) on Feb 23, 2010 at 18:12 UTC

    I have verified that both servers have identical registry entries for the dlls in question, which is why I am noodling this forum for advice. The diffs at the system level, from what I can tell, are limited to perl version and Win32::OLE.

      I now believe the issue is related to the 64 bit version of Perl trying to use Win32::OLE to read a 32 bit *registered* DLL, which cannot be done without some creative wrapper work. On a 64 bit OS, you can register 64 and 32 bit DLL's, but 64 bit software can't read 32 bit DLL's, even if they are registered. Here are some articles on the topic:

      http://support.microsoft.com/kb/282423

      “64-bit programs cannot load and call 32-bit MDAC”

      http://www.dnjonline.com/article.aspx?id=jun07_access3264

      “The best way to migrate such a product to a 64-bit platform is to migrate both the main module and the dependency DLL, but if the dependency DLL cannot be migrated then it cannot be loaded into the 64-bit process and the application won't work.”

      “One possible way of … is to implement a 64-bit wrapper' DLL that exposes the same functions, parameters, types and so forth as the original 32-bit DLL. This wrapper DLL can then make IPC-based calls to the original 32-bit DLL, which has been loaded into a surrogate process.”

      It's too bad that Win32::OLE, when used by a 64 bit version of Perl, apparently does not by itself act as the wrapper that performs IPC-based calls to the original 32 bit DLL. Does anyone know of a module we can use in place of Win32::OLE that can perform the appropriate translation so we can use a 32 bit DLL in a 64 bit version of Perl?

        I don't know if there is a module available to help with this, but a rather inelegant solution that I have come up with is to install Perl x86 on the 64-bit server and then from a %windir%\SysWoW64\cmd.exe (32-bit command prompt), run the script in question. For our needs, this should be sufficient as the scripts we use are administrative in nature so we would be using them interactively. A couple of them would run as scheduled tasks so I will need to come up with a solution to allow those scripts to be run automatically. Everything else on our system can use the x64 version of Perl just fine since it doesn't need to access any of the 32-bit DLLs. This is just one solution and may not be useful in every case.