G
Guest
I am trying to call an unmanaged dll from c#, the function is asyncronous and expects a callback function and a parameter which is labelled lpvoid but which expects the address of the calling object, which is then returned by the callback function. Using a delegate the call back function works perfectly and I can pass value objects as parameters, but a not reference object, is it possible and if so how do you do it.
PS I had hoped to get away with ignoring the parameter, as I expected the delegate to return to callback function of the object that called it. But when used from muliple objects simultaneously, all the callbacks are to the last object that calls the function. In other words, the unmanaged code always calls back on the last function given it.
PS I had hoped to get away with ignoring the parameter, as I expected the delegate to return to callback function of the object that called it. But when used from muliple objects simultaneously, all the callbacks are to the last object that calls the function. In other words, the unmanaged code always calls back on the last function given it.