>I am wrapping a digital camera API using Managed C++ VS .NET 2003). I
> have this function that called as bellow in the API sample.
[quoted text clipped - 12 lines]
> Line 3 -> error C2276: '&' : illegal operation on bound member function
> expression.
> Hello,
>
[quoted text clipped - 17 lines]
> Why do you think it's appropriate to pass managed pointer into the native
> function?
I was at that time looking for quick fix to my problem and experiment
here and there on what I can do with mix managed and unmanaged class.
It appears that __pin allow me to pass "this" pointer to unmanaged
class. It does work. however please read my conclussion at the end of
this post.
> Do you have an example for this API?
The example that I get for this API is purely c++ (not managed
extension sample).
> P.S. There is nothing old in this style of callback API.
I am referring to it with delegate callback style in mind. But you are
right that there is nothing old about it since delegate mainly applies
to .NET or managed c++. Well I can be wrong about this too.
> --
> Vladimir Nesterovsky
At the end of the experiment process I have decided to follow Bruno
van Dooren advise to use unmanaged C++ to interact with the SDK. By
doing this there is no need to pin "this" pointer. I have choosen this
as I have some doubt regarding pinning "this" pointer and passing it to
callback function that will run through the application/dll runtime.
My initial __pin "this" try is successful but I suspect that this is a
time bomb waiting to explode :D.
Thanks all and best regards!