471,066 Members | 1,230 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

CTypes, 64 bit windows, 32 bit dll

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
Mar 31 '08 #1
6 17579
On Mar 31, 10:22 am, rdahlstrom <roger.dahlst...@gmail.comwrote:
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."
Mar 31 '08 #2
On Mar 31, 4:22 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:
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 ...
Mar 31 '08 #3
On Mar 31, 12:53 pm, "mimi.vx" <mimi...@gmail.comwrote:
On Mar 31, 4:22 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:
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?
Mar 31 '08 #4
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
Mar 31 '08 #5
rdahlstrom <ro*************@gmail.comwrote:
>On Mar 31, 12:53 pm, "mimi.vx" <mimi...@gmail.comwrote:
>On Mar 31, 4:22 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:
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.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Apr 1 '08 #6
On Apr 1, 2:03 am, Tim Roberts <t...@probo.comwrote:
rdahlstrom <roger.dahlst...@gmail.comwrote:
On Mar 31, 12:53 pm, "mimi.vx" <mimi...@gmail.comwrote:
On Mar 31, 4:22 pm, rdahlstrom <roger.dahlst...@gmail.comwrote:
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.
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
Shoot. Alright, thanks for your help. I guess I'll have to roll out
a 64-bit version of the tibco software.
Apr 1 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Thomas Heller | last post: by
19 posts views Thread by Thomas Heller | last post: by
6 posts views Thread by Mudcat | last post: by
9 posts views Thread by jtravs | last post: by
5 posts views Thread by SoutoJohn | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.