473,583 Members | 3,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.GetTy pe(), "LED green on.ico")
Else
o.Image = New Bitmap(Me.GetTy pe(), "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
0 963

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4755
by: Avi Kak | last post by:
Hello: Please forgive me if my question is too silly or just not well-formed. Wesley Chun in his book (Core Python Programming) says that **everything** in Python is an object. So I became curious about the precise definition of an object in Python. My curiosity was also driven by Wesley's statement that while every class instance is...
9
11099
by: talljames | last post by:
Has anyone come across this exception before when dealing with C# graphics? Have come across some answers that point to the accelleration control under the screen's properties/settings/advanced/troubleshooting. ie the graphics driver. Other answers include disposing, revalidate. Any suggestions would be appreciated.
4
5013
by: 6tc1 | last post by:
Hi all, I have just finished debugging a windows application and have solved the problem - however, I want to be sure that I understand the problem before I move on. Before I detail the problem, this problem requires some understanding of threading concepts. Basically, the class contained both a PictureBox object as well as a corresponding...
1
3220
by: Hadar | last post by:
Hi, I'm getting "object is currently in use elsewhere" when I use System.Drawing.Graphics.MesureString. This is what I do: My controls use a utility class the helps it to mesure strings. To get the best performance for the utility class, its members, as well as the System.Drawing.Graphics object, are static:
1
2400
by: kCura | last post by:
First off, I'm sorry if this isn't the write thread to post this message but I couldn't find one dedicated to System.Drawing. I'm developing an intranet application in VB.NET that uses a Hosted Windows Form (HWF) dedicated to image manipulation. This HWF is also supposed to allow the user to print an image to their default printer. I'm using...
7
2568
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be stupid or missing the point. I used DrawString( ) as a simple test but I cannot get it to work at all unless I handle my custom controls Paint event.
4
5702
by: JJ | last post by:
When I run my form prog, if I maximise, then minimise (i..i. force the GUI to redraw) I get the following error: "The object is currently in use elsewhere" At this line: e.Graphics.DrawString(MenuText.Substring(0, 1), underLinedFont, FontBrush, textLayoutRectangle, sf)
4
2277
by: =?Utf-8?B?Qm9uaQ==?= | last post by:
Hi, I got this problem. I'm implementing a pluggable winform program. My plugins are usercontrol and I load them in my program through a interface. Now if I close my application an error occurs: "Object is currently in use elsewhere". If I comment the line where a I use the Activator.CreateInstance it doesn't happen. I tried to disposed the...
275
12169
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
2317
by: para15000 | last post by:
Hello I have a C# desktop application in which one thread that I create continously gets an image from a source(it's a digital camera actually) and puts it on a panel(panel.Image = img) in the GUI(which must be another thread as it is the code-behind of a control. The application works but on some machines I get the following error...
0
7894
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7824
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8176
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7931
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8191
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5699
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5370
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.