|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-30 16:37:30
From: "DudeSan" <dudesan_at_[hidden]>
> > No, this won't work. boost::bind returns a function object, an object
> with
> > operator() defined, not a function pointer. You can't use bind() to
> create
> > a function pointer.
>
> So, are there any suggestions or ideas that I could use?
>
> I'm trying to make the wndProc point at a member function. I've got it
> too work with functors but I figured boost might get handy since I'm
> converting a class::function to a function.
A wndProc is a function pointer. It can't be made to point to a nonstatic
member function; these need a pointer to the object ("this") as an implicit
first argument.
Are you sure you got it to work with functors?
The usual solutions are either using Set/GetWindowLong(hWnd, GWL_USERDATA)
to store a pointer to the object, or using a std::map< HWND,
boost::function<HWND, UINT, WPARAM, LPARAM> >.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk