EOutOfResources (Error creating window device context)

EOutOfResources (Error creating window device context)

I have this unusual error in my XE2 app that is showing up in the auto-crash logs that MadExcept sends to my web-server. It doesn't happen for all installations, just a fraction and I haven't been able to duplicate it. (full details on crash below). I'm using XE2 with Update 4 HotFix 1, Help Update 6 and IDE Fix Pack XE2 5.4

In doing some searching, I found this QC. It doesn't have any votes and his solution was to set MaxHeight=MaxWidth=MinHeight=MinWidth=0 and WordWrap=true for TRadioGroups..

http://qc.embarcadero.com/wc/qcmain.aspx?d=106425

The error is "EOutOfResources" and the entry point is VCL.forms.TApplication.Run()

The call stack looks like this...

main thread ($624):
0053071e +042 myXE2appwin.exe Vcl.Controls   TWinControl.GetDeviceContext
00525e9b +083 myXE2appwin.exe Vcl.Controls   TControlCanvas.CreateHandle
0050018d +025 myXE2appwin.exe Vcl.Graphics   TCanvas.RequiredState
004ff8a0 +018 myXE2appwin.exe Vcl.Graphics   TCanvas.FillRect
0067e65f +273 myXE2appwin.exe RzPanel        TRzCustomPanel.Paint
00533803 +057 myXE2appwin.exe Vcl.Controls   TCustomControl.PaintWindow
0052dc9d +055 myXE2appwin.exe Vcl.Controls   TWinControl.PaintHandler
0052e49c +048 myXE2appwin.exe Vcl.Controls   TWinControl.WMPaint
0053379d +011 myXE2appwin.exe Vcl.Controls   TCustomControl.WMPaint
00529189 +2bd myXE2appwin.exe Vcl.Controls   TControl.WndProc
0052dae7 +5b3 myXE2appwin.exe Vcl.Controls   TWinControl.WndProc
0052d13c +02c myXE2appwin.exe Vcl.Controls   TWinControl.MainWndProc
00491f68 +014 myXE2appwin.exe System.Classes StdWndProc
77c50117 +02b ntdll.dll                      KiUserCallbackDispatcher
77c6e72d +078 ntdll.dll                      RtlAnsiStringToUnicodeString
0061001d +229 myXE2appwin.exe RzCommon       GetXPThemeColor
771333c8 +010 kernel32.dll                   BaseThreadInitThunk
http://qc.embarcadero.com/wc/qcmain.aspx?d=106425

Comments

  1. Synchronize is marked as "never use ever, except never" in my little black book of threading.

    ReplyDelete
  2. Lars Fosdal I think it can have its place depending on the applications architecture, sometimes you have to work with whats already been implemented. I'm not advocating using it, just mentioning an instance I had struck it in the hope it may help Vin.  Sometimes these errors don't seem to make any sense, especially when it happens on only some machines.

    ReplyDelete
  3. Thanks! I'll start going through things harder. It's probably a memory leak problem that is manifesting itself as something else... I say this, because I've been trying to track another leak down for a few days that is resulting in a TList containing a completely different object used in a TObjectList. Not supposed to happen. So I'll bet there's something in there that's giving the strange behavior. I just did an audit of the source and found 4x TThreadedTimer being used. No syncronize used, but it does hit objects used by the main TForm. haha.

    ReplyDelete

Post a Comment