CallbackOnCollectedDelagate was detected

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

CallbackOnCollectedDelagate was detected

Postby bobrusso » Mon Aug 15, 2011 5:32 pm

...when I'm using the C# wrapper
'A callback was made on the garbage collected delegate of type UsbUirtManagedWrapper!UsbUirt.Controller+ReceiveCallback::Invoke'
The error message is random, and occurs regardless of the 'myCb= new ReceiveCallback.....' conditional compilation in the'Controller.cs' code.
It does occur the instant the USBUirt receives an IR signal.
I've read the Microsoft sugestions. Other than including the 'myCB...' code in the controller module of the wrapper, I'm at a loss on how to resolve this. Any suggestions? Thanks.
bobrusso
 
Posts: 3
Joined: Wed Jul 27, 2011 7:49 pm

Postby bobrusso » Thu Aug 18, 2011 1:32 pm

As it turned out, the problem had little if anything to do with the wrapper. The callback routine was logging to a file using File.AppendAllText(...), and was apparently in conflict with another logging operation to the same file that was occuring in a different thread. I'm not sure why it generated that error.
bobrusso
 
Posts: 3
Joined: Wed Jul 27, 2011 7:49 pm

Postby bobrusso » Wed Sep 21, 2011 6:42 pm

Ahh, wrong again. The problem is just less frequent. In fact, I've found tht the same code has errors on any platform in which it runs, but it appears to be resource dependent. The more 'things' that are going on in the target machine, the more frequently the error occurs. On high power, multi-core, large memory machines(4Gig), the problem appears infrequently. On atom processors with 1Gig of memory, the problem occurs very often.

I've rewritten the VB.NET code to NOT use a form, but as a console application to more closely emulate the structure of the Wrapper example, but the problem remains.

Anyone have an idea?

Has anyone been successful with a VB.Net-Wrapper application?

Thanks.
bobrusso
 
Posts: 3
Joined: Wed Jul 27, 2011 7:49 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 21 guests

cron