boost::function and managed code

I'm looking for a way to get a boost::function to do a callback to a method of a managed C++ class in VS7.1. Has anyone managed to do this yet? Thanks Russell

Russell Hind wrote:
I'm looking for a way to get a boost::function to do a callback to a method of a managed C++ class in VS7.1. Has anyone managed to do this yet?
Have you tried pinning your object and then create a functor from that pin using boost::bind ? I believe your object must stay pinned else it can move in GC memory and the address which is eventually called will go to a member function which is no longer there.

Edward Diener wrote:
Have you tried pinning your object and then create a functor from that pin using boost::bind ? I believe your object must stay pinned else it can move in GC memory and the address which is eventually called will go to a member function which is no longer there.
Thanks, I'll have a go and see where I get to. Cheers Russell
participants (2)
-
Edward Diener
-
Russell Hind