ctypes windll question

T

Tzury

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.
 
T

Tzury

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....
 
S

sturlamolden

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.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top