469,641 Members | 1,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,641 developers. It's quick & easy.

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 2667
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Srijit Kumar Bhadra | last post: by
6 posts views Thread by Srijit Kumar Bhadra | last post: by
reply views Thread by Srijit Kumar Bhadra | last post: by
6 posts views Thread by Mudcat | last post: by
5 posts views Thread by SoutoJohn | last post: by
reply views Thread by Tzury | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.