On Mon, Apr 30, 2012 at 9:11 PM, Ehsan Pi <ehsanpii@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.