Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^3: Perl Version and Win32::OLE

by bbrownlee (Initiate)
on Feb 23, 2010 at 21:06 UTC ( #824942=note: print w/replies, xml ) Need Help??

in reply to Re^2: Perl Version and Win32::OLE
in thread 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:

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

“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?

Replies are listed 'Best First'.
Re^4: Perl Version and Win32::OLE
by nimdokk (Vicar) on Sep 08, 2011 at 16:24 UTC
    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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://824942]
[Spenser]: thanks

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2018-03-17 13:12 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (224 votes). Check out past polls.