|
Boost Users : |
From: Olenhouse, Jason (jason.olenhouse_at_[hidden])
Date: 2005-03-11 12:20:06
Ben Hutchings wrote:
> Olenhouse, Jason wrote:
> > I'm trying to pass a member function pointer around to the Windows
> > Service Control Manager through Windpws API functions, but
> > I think I'm having troubles with the __stdcall convention.
> <snip>
>
> No, the problem is passing a member function pointer. A
> member function
> pointer is not type-compatible with a function pointer with the same
> parameter types, regardless of whether they have the same calling
> convention.
<snip>
But I used boost::bind to get a function pointer to hide the implicit this. I thought that the
purpose of boost::bind was for that reason. It seems that the way I did it was nearly successful
other than function::target<>() returns a __cdecl function pointer instead of an __stdcall one, as
indicated by the error that MSVC returns.
Is my interpretation of what I'm seeing incorrect?
BTW, I included the two defines,
#define BOOST_BIND_ENABLE_STDCALL
#define BOOST_MEM_FN_ENABLE_STDCALL
to be able to bind __stdcall member function with the this object pointer (I forgot to mention this in
the original post).
-Jason
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net