Christopher Secules
11/22/2004 10:30:00 PM
I am writing an application that uses remoting and the GDI graphics class to
update a bitmap that is getting displayed on the Client (UI). The server
receives commands from a controller over the serial port, and when a
complete command comes in, it interprets it. Interpretation of these
commands might involve the GDI graphics class. For example, commands
include drawing a line, drawing a circle, and drawing text. The bitmap gets
updated after every action, and then the Client senses the change and upates
itself.
I believe I am running into a problem with drawing on the bitmap. Randomly,
I get 1 of 2 possible exceptions:
The object is currently in use elsewhere.
and
Object reference not set to an instance of an object.
Normally, I would be able to track down where it is originating. However,
the InnerException was not set and the Stacktrace didn't come up with
anything useful. I only thought is that commands are coming in over the
serial port too fast and things are getting tied up. Any suggestions to
either get to the bottom of this, or to fix it? I was considering a
Synclock around my command interpretation routine.
Thanks.