[Mono-list] interop delegate/callback problem

Lloyd Dupont lloyd@galador.net
Tue, 13 Nov 2001 01:19:12 +0100


This is a multi-part message in MIME format.
--------------080505090900050505020306
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello fellow users !
Any who wants to look at my bug ?

i create a C struct with some function pointer (in fact C# delegate)
and reference it in C# as an IntPtr.

later i execute some interop function taking my struct as an argument 
and calling my function pointer.
strangely, after a few call, there is strange error, such as (most 
curious) NullReferenceException when returning from my C# delegate 
callback to my C code....

i join you my project so you could test....
anyone has any idea ?

--------------080505090900050505020306
Content-Type: application/x-compressed;
 name="tdelegate.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="tdelegate.tgz"

H4sIAJeu7TsAA+1Z/0/bOhDn1yDxP3hsD6UUQlq+VKLr9BiUjbcyEAVNGo9XhcRto6VOX+wC
ZeJ/f3e2kzotX/eFTXq1NpKcz+e7j893Z1cENKIdT1DHn/lZzS257sba2ozruqXKekk+4R8+
sZXX3MqMW1mtrLql9bX1MvCXKhtrM8T9aRoZbcCFlxAyE0XxMLiH72PM6HPo88xtZYV0fJ8s
866X0IAsx0RkHhFEkfHlz82+DJkfDQJKXnMRROG5030zRgxjRQtoO2SU7DQaB2//Iq1WQP2I
96lvg0x61Y8TUZibnZsVwz4FVsJFMvAFae40Wkef4j4nX+dmrZAJYi9ySr8U7AmGRT9mgl6J
JYJscbvNqX6/7FLm00I1k5BQL3hQQkTZErmIw4As9kVijL5MQkG/fbgfxfy+4ch6M6JXERVY
k+XHNeTWGBuiyc6+fNtN4l5TgPk9O9OHtCWg5BsQXSKGFAnqg1IMWAjikhPxZGQnRTyILngZ
utIkAwljUrtN/wLpeRALfJuH1zRu21lXQa1q234RxiDWshIqBgkjH08aDdkTL79BbAm0moI5
JSNYmoyvKVkCoMjyNaVLqxRdviJdTxbG6C/ZoktcstWm1M5bqK2f0BkFtpEdqEreaMu+Pdlt
Nfc+10nZHZ8Gdd+Kotsn8SGA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