Topaz Filer - Email filing software
Out of memory. at System.Drawing.Graphics.FromHdcIn
Messages   Related Types
This message was discovered on microsoft.public.vsnet.debugging.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Karthik
Hi,

I have a context menu which is to be displayed at a
particular point in the form.

The code is as below.

ContextMenu1.Show(m_Begin, p) where m_Begin is the control
and p is the locn at which i want to show.

However, after i run the app and use it for sometime, i am
getting an unhandled exception
System.OutOfMemoryException: Out of memory.
at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)
at System.Windows.Forms.MenuItem.WmDrawItem(Message& m)
at System.Windows.Forms.Control.WmDrawItemMenuItem
(Message& m)
at System.Windows.Forms.Control.WmDrawItem(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage
(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc
(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Has anyone seen this and knows how to avoid this ?

Pls help.

Karthik

Reply to this message...
Vote that this is a GOOD answer...
 
New BootFX DBGet build available
Twitter and Snow… simple #uksnow
 
    
Robert Gruen [MSFT] (VIP)
Karthik,

This appears to be a known issue that will be addressed by future service
pack. Until that time I'm afraid there isn't a known workaround. If you'd
like us to investigate it further you can open up a support incident and we
can ensure that you are indeed experiencing a known issue or if something
in your code is causing this.

Thanks! Robert Gruen
Microsoft, VB.NET

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Karthik" <Click here to reveal e-mail address>
| Sender: "Karthik" <Click here to reveal e-mail address>
| Subject: Out of memory. at System.Drawing.Graphics.FromHdcIn
| Date: Mon, 22 Dec 2003 23:27:33 -0800
| Lines: 35
| Message-ID: <069801c3c926$3b233850$Click here to reveal e-mail address>
| MIME-Version: 1.0
| Content-Type: text/plain;
|     charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcPJJjsjGqorUeWATPOIOzaxYuh69w==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.vsnet.debugging
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.vsnet.debugging:4453
| NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
| X-Tomcat-NG: microsoft.public.vsnet.debugging
|
| Hi,
|
| I have a context menu which is to be displayed at a
| particular point in the form.
|
| The code is as below.
|
| ContextMenu1.Show(m_Begin, p) where m_Begin is the control
| and p is the locn at which i want to show.
|
| However, after i run the app and use it for sometime, i am
| getting an unhandled exception
| System.OutOfMemoryException: Out of memory.
| at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)
| at System.Windows.Forms.MenuItem.WmDrawItem(Message& m)
| at System.Windows.Forms.Control.WmDrawItemMenuItem
| (Message& m)
| at System.Windows.Forms.Control.WmDrawItem(Message& m)
| at System.Windows.Forms.Control.WndProc(Message& m)
| at System.Windows.Forms.ButtonBase.WndProc(Message& m)
| at System.Windows.Forms.Button.WndProc(Message& m)
| at System.Windows.Forms.ControlNativeWindow.OnMessage
| (Message& m)
| at System.Windows.Forms.ControlNativeWindow.WndProc
| (Message& m)
| at System.Windows.Forms.NativeWindow.Callback(IntPtr
| hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
| Has anyone seen this and knows how to avoid this ?
|
| Pls help.
|
| Karthik
|
|

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Mike Snyder
Has there been any other information about this yet? I'm experiencing the same thing and cannot track down the problem.

--------------------------------
From: Mike Snyder
Reply to this message...
Vote that this is a GOOD answer...
 
 
 
System.Drawing.Graphics
System.IntPtr
System.OutOfMemoryException
System.Windows.Forms.Button
System.Windows.Forms.ButtonBase
System.Windows.Forms.Control
System.Windows.Forms.MenuItem
System.Windows.Forms.NativeWindow




Topaz Filer - Email filing software
Ad
BootFX
Reliable and powerful .NET application framework.
Looking to invest in a major software project? Technical and commercial advice available here.
Other Helpful Sites
MBR 247
Topaz Filer
SharePoint Email Filing
Software Advisory Services
 
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734