Urgent help required: The object is currently in use elsewhere | | |
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? | | | | re: Urgent help required: The object is currently in use elsewhere
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
"JJ" <abc@xyz.com> wrote in message
news:%23H0L5mqRGHA.4792@TK2MSFTNGP14.phx.gbl...[color=blue]
> 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?
>
>
>[/color] | | | | re: Urgent help required: The object is currently in use elsewhere
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.
"JJ" <abc@xyz.com> wrote in message
news:%23H0L5mqRGHA.4792@TK2MSFTNGP14.phx.gbl...[color=blue]
> 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?
>
>
>[/color] | | | | re: Urgent help required: The object is currently in use elsewhere
No it didn't - error is still there.
Anyone come across this?
"JJ" <abc@xyz.com> wrote in message
news:%23cgc$1sRGHA.3192@TK2MSFTNGP09.phx.gbl...[color=blue]
> 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.
>
>
>
>
> "JJ" <abc@xyz.com> wrote in message
> news:%23H0L5mqRGHA.4792@TK2MSFTNGP14.phx.gbl...[color=green]
>> 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?
>>
>>
>>[/color]
>
>[/color] | | | | re: Urgent help required: The object is currently in use elsewhere
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
"JJ" <abc@xyz.com> wrote in message
news:%23H0L5mqRGHA.4792@TK2MSFTNGP14.phx.gbl...[color=blue]
> 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?
>
>
>[/color] |  | Similar Visual Basic .NET bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,471 network members.
|