Thanks Roman for your quick reply, That's what confuses me. HWND is essentially a pointer to an int to hold the window handle. How can to convert them to each other?
Ehsan On Mon, Apr 30, 2012 at 2:46 PM, Roman Yakovenko <roman.yakove...@gmail.com>wrote: > On Mon, Apr 30, 2012 at 9:11 PM, Ehsan Pi <ehsan...@gmail.com> wrote: > > In python I get the not-match error: > > > > >>> import MyWrapper > > >>> import win32gui > > >>> hwnd = win32gui.GetDesktopWindow() > > >>> foo = MyWrapper.Foo(hwnd) > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > Boost.Python.ArgumentError: Python argument types in > > Foo.__init__(Foo, int) > > did not match C++ signature: > > __init__(struct _object *, struct HWND__ * window) > > >>> > > > > How can I correct this problem to be able to pass a window's handle (from > > win32gui) in Python to C++ class, and interact with it? > > I think the error is pretty clear: the exported constructor expects a > pointer to some struct(?) HWND__, while, win32gui returns the handle > as integer. You will have to find some way to associate handle as > integer with handle as HWND__. Once you find it, you can use > "make_constructor" functionality, which is also supported by py++. > > HTH. > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig >
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig