By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

The Object is currently in use elsewhere!!???????

P: n/a
I have an HMI application which shows the status of a machine.
In the background I have 7 threads, each receiving status info from
the machine and generating events when the status is changed.
The graphical part only has to display some info based on those
events.
Once in a while, Sometimes 10 minutes, sometimes 10 hours.... The
application freezes because one of the event handler never returns.
After some tracing I found that it has to do with displaying bitmaps.

example code which might cause the problem:

If value Then
o.Image = New Bitmap(Me.GetType(), "LED green on.ico")
Else
o.Image = New Bitmap(Me.GetType(), "LED green off.ico")
End If

Where o is an object which has been validated before.
This kind of code is used in several places, and the code is crashing
in as many as those places.

I'm suspecting that GDI is not executing (drawing) the bitmaps in a
synchronous way. So sometimes the GDI is busy doing whatever while I'm
trying to draw a new bitmap....

Does anyone have experience with this phenomena??

Jacco

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.