473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 18448
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: zapazap | last post by:
Dear Snake Charming Gurus, (Was: http://mail.python.org/pipermail/python-list/2004-January/204454.html) First, a thank you to Tim Golden, Thomas Heller, and Mark Hammond for your earlier help...
1
by: Thomas Heller | last post by:
ctypes 0.9.1 released - Sept 14, 2004 ===================================== Overview ctypes is a ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call...
19
by: Thomas Heller | last post by:
ctypes 0.9.2 released - Oct 28, 2004 ==================================== Overview ctypes is a ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call...
3
by: p.lavarre | last post by:
Subject: Python CTypes translation of (pv != NULL) And so then the next related Faq is: Q: How should I test for ((void *) -1)? A: (pv == 0xffffFFFF) works often.
6
by: Mudcat | last post by:
Hi, I can't figure out why ctypes won't load the DLL I need to use. I've tried everything I can find (and the ctypes website is down at the moment). Here's what I've seen so far. I've added...
9
by: jtravs | last post by:
Hi all, I suspect that I'm doing something stupid, I would like some other opinions though. I'm getting started with ctypes and am trying to use distutils to help build my module. At the moment...
5
by: SoutoJohn | last post by:
I'm trying to install PyWinAuto for Python 2.4. It said that one of the required libraries that I need to install would be CTypes. So I head over to CTypes's SourceForge page and I installed CTypes...
0
by: malen | last post by:
Hi all! I'm building mouse movement filter program for Windows and Mac OS X. In Windows I use ctypes.windll.user32.getCursorPos(pointer) and ctypes.windll.user32.setCursorPos(x,y) to get and set...
0
by: Egor Zindy | last post by:
Egor Zindy wrote: #!/usr/bin/env python """ A generic chipid library based on ctypes This module handles most of the functions in FTChipID.dll
0
by: Tim Grove | last post by:
Thanks for your advice Gerdus, but I have tried your suggestion with no success. It has at least been beneficial to discover a tool which I did not know about in 'Dependency Walker'; all...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.