Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Perl Version and Win32::OLE

by bbrownlee (Initiate)
on Feb 23, 2010 at 21:06 UTC ( [id://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:

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?

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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://824942]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-19 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found