Urgent help required: The object is currently in use elsewhere

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

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)

(An ownerdraw menu)

This only happens when I have Microsoft Word open in the background and have
a graphic placed in the word document.

I have just reinstalled all Visual Studio and Sourcesafe and I still cannot
get rid of the error.

What have I done wrong?
 
I should add that this problem arose after I replaced the hard disk on my PC
and reinstalled the OS etc.
I can still boot to the old disk and the forms app runs fine there.

Even if I copy that exact version of the program to my new disk, boot from
that disk and run it, the problem wtill occurrs.

I've tried deleting then adding all me references. What on earth could be
wrong here?

Please help if you can
 
Weird. I got rid of a dispose a few lines later and all seems well:

underLinedFont.Dispose()

Why this made a difference when I'd replaced my hard disk I do not know.
Hopefully not disposing of this font won't cause any memory/recource
problems.
 
For anyone else experiencing this problem:

Description:
Upon reinstalling your OS, your Visual Studio forms application crashes
itself (even in debugging mode), or crashes other programs displaying
graphics, when refreshing, and in particular when carrying out drawstring
commands. You may get the error "The object is currently in use elsewhere"
when carrying out Drawstring commands.

Solution:
Update your graphics drivers!!

I am using an ATi Radeon X850 XT. The driver that caused the faults was
version 6.14.10.6525 released 29/3/2005. This version is still being
supplied by Dell, as far as I know, as this is where I got it.
Renew it for the latest version on ATi's web site. I am now using version
8.231.0.0, released 21/02/2006 and all errors have gone.

To Reiterate:
This is not a problem with Visual Studio, Sourcesafe, Net framework 1.1, but
appears to be a fault with the older ATI video driver.


I will continue to test, but at the moment all is looking good.

Hope this helps someone.

J
 
Back
Top