CTypes, 64 bit windows, 32 bit dll

R

rdahlstrom

So I have a 64 bit Windows 2003 system, running python 2.5.1.1.

I can import a Windows .dll (msvcrt or whatever) using ctypes, but
when attempting to import another application-specific .dll (tibrv.dll
if anyone is familiar with it), I receive the error WindowsError:
[Error 193] %1 is not a valid Win32 application.

I know there's a Windows on Windows (wow) which allows 32 bit
processes to run on 64 bit windows - is there a way to work this in
somehow? Maybe I'm barking up the wrong tree?

Code is simple, and works on 32 bit systems no

from ctypes import *
#this doesn't work
tibrv = cdll.tibrv
#this does work
msvcrt = cdll.msvcrt
 
R

rdahlstrom

So I have a 64 bit Windows 2003 system, running python 2.5.1.1.

I can import a Windows .dll (msvcrt or whatever) using ctypes, but
when attempting to import another application-specific .dll (tibrv.dll
if anyone is familiar with it), I receive the error WindowsError:
[Error 193] %1 is not a valid Win32 application.

I know there's a Windows on Windows (wow) which allows 32 bit
processes to run on 64 bit windows - is there a way to work this in
somehow? Maybe I'm barking up the wrong tree?

Code is simple, and works on 32 bit systems no

from ctypes import *
#this doesn't work
tibrv = cdll.tibrv
#this does work
msvcrt = cdll.msvcrt

And by "works on 32 bit systems no", I mean "works on 32 bit systems
no problem."
 
M

mimi.vx

So I have a 64 bit Windows 2003 system, running python 2.5.1.1.

I can import a Windows .dll (msvcrt or whatever) using ctypes, but
when attempting to import another application-specific .dll (tibrv.dll
if anyone is familiar with it), I receive the error WindowsError:
[Error 193] %1 is not a valid Win32 application.

I know there's a Windows on Windows (wow) which allows 32 bit
processes to run on 64 bit windows - is there a way to work this in
somehow? Maybe I'm barking up the wrong tree?

Code is simple, and works on 32 bit systems no

from ctypes import *
#this doesn't work
tibrv = cdll.tibrv
#this does work
msvcrt = cdll.msvcrt

all dlls and python must be 32bit or 64bit, no mixed ...
 
R

rdahlstrom

So I have a 64 bit Windows 2003 system, running python 2.5.1.1.
I can import a Windows .dll (msvcrt or whatever) using ctypes, but
when attempting to import another application-specific .dll (tibrv.dll
if anyone is familiar with it), I receive the error WindowsError:
[Error 193] %1 is not a valid Win32 application.
I know there's a Windows on Windows (wow) which allows 32 bit
processes to run on 64 bit windows - is there a way to work this in
somehow? Maybe I'm barking up the wrong tree?
Code is simple, and works on 32 bit systems no
from ctypes import *
#this doesn't work
tibrv = cdll.tibrv
#this does work
msvcrt = cdll.msvcrt

all dlls and python must be 32bit or 64bit, no mixed ...

Crap, no way to make a 32 bit load, even using the wowexec?
 
M

Martin v. Löwis

Crap, no way to make a 32 bit load, even using the wowexec?

With WoW64, you can run 32-bit processes on a 64-bit system
(as you do all the time). That's all it does.

You cannot load a 64-bit DLL into a 32-bit application, or
vice versa.

If you want to load a 32-bit DLL on Win64, use the 32-bit
Python.

Regards,
Martin
 
T

Tim Roberts

rdahlstrom said:
So I have a 64 bit Windows 2003 system, running python 2.5.1.1.
I can import a Windows .dll (msvcrt or whatever) using ctypes, but
when attempting to import another application-specific .dll (tibrv.dll
if anyone is familiar with it), I receive the error WindowsError:
[Error 193] %1 is not a valid Win32 application.
I know there's a Windows on Windows (wow) which allows 32 bit
processes to run on 64 bit windows - is there a way to work this in
somehow? Maybe I'm barking up the wrong tree?
...

all dlls and python must be 32bit or 64bit, no mixed ...

Crap, no way to make a 32 bit load, even using the wowexec?

No. In Win64, a process is either entirely 32-bit, or entirely 64-bit. To
do the kind of crossing you seek, you would need to create a separate
process for the 32-bit DLL and use interprocess communication.
 
R

rdahlstrom

rdahlstrom said:
So I have a 64 bit Windows 2003 system, running python 2.5.1.1.
I can import a Windows .dll (msvcrt or whatever) using ctypes, but
when attempting to import another application-specific .dll (tibrv.dll
if anyone is familiar with it), I receive the error WindowsError:
[Error 193] %1 is not a valid Win32 application.
I know there's a Windows on Windows (wow) which allows 32 bit
processes to run on 64 bit windows - is there a way to work this in
somehow? Maybe I'm barking up the wrong tree?
...
all dlls and python must be 32bit or 64bit, no mixed ...
Crap, no way to make a 32 bit load, even using the wowexec?

No. In Win64, a process is either entirely 32-bit, or entirely 64-bit. To
do the kind of crossing you seek, you would need to create a separate
process for the 32-bit DLL and use interprocess communication.

Shoot. Alright, thanks for your help. I guess I'll have to roll out
a 64-bit version of the tibco software.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top