473,379 Members | 1,544 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,379 software developers and data experts.

ctypes windll question

I followed the tutorial about ctypes and I still cannot figure out how
to call a method of a calss within the dll.

For example:
a dll named 'foo' contain a class named 'bar' which expose a method
named 'baz'.

if I either do:

mydll = windll.foo
mycls = mydll.bar

or
mycls = windll.foo.bar

or
mycls = windll.foo.bar()

I get an erros: "function 'bar' not found " which is right, since bar
is a class and not a function. However, I still need to create an
instance of this inner class (bar) so I can access its public method
(baz).

I cannot find anywhere instructions for that.

Aug 14 '07 #1
2 2771
I discovered pywin32-210.win32-py2.5 package which does all the work
for me.

Open Software world is a great place to live by....

On Aug 14, 12:45 pm, Tzury <Afro.Syst...@gmail.comwrote:
I followed the tutorial about ctypes and I still cannot figure out how
to call a method of a calss within the dll.

For example:
a dll named 'foo' contain a class named 'bar' which expose a method
named 'baz'.

if I either do:

mydll = windll.foo
mycls = mydll.bar

or
mycls = windll.foo.bar

or
mycls = windll.foo.bar()

I get an erros: "function 'bar' not found " which is right, since bar
is a class and not a function. However, I still need to create an
instance of this inner class (bar) so I can access its public method
(baz).

I cannot find anywhere instructions for that.

Aug 14 '07 #2
On Aug 14, 11:45 am, Tzury <Afro.Syst...@gmail.comwrote:
I followed the tutorial about ctypes and I still cannot figure out how
to call a method of a calss within the dll.
ctypes interfaces with C, not C++. C++ compilers do various forms of
name manging, create virtual tables, etc. that are compiler dependent.
You cannot call C++ from ctypes.


Aug 15 '07 #3

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: Srijit Kumar Bhadra | last post by:
Hello, Here are code snippets to create and access shared memory in Python with and without ctypes module. With regards, Srijit Filename : SharedMemCreate.py import msvcrt, mmap
6
by: Srijit Kumar Bhadra | last post by:
Hello, Here is an example of Multithreaded Pipe Server and Client using the excellent ctypes library (Windows). Reference - MSDN:...
0
by: Srijit Kumar Bhadra | last post by:
Hello, Here is some sample code with pywin32 build 203 and ctypes 0.9.6. Best regards, /Srijit File: SharedMemCreate_Mutex_win32all.py # This application should be used with...
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...
0
by: looping | last post by:
Hi, I need to get the FileVersion of some files on Windows. The best way look like to use function GetFileVersionInfo from the Windows API. I first try with pywin32 and it work well, but with...
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: Tzury | last post by:
I followed the tutorial about ctypes and I still cannot figure out how to call a method of a calss within the dll. For example: a dll named 'foo' contain a class named 'bar' which expose a...
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.