Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Sep : When is EOutOfResources simply not true...
| Subject: | When is EOutOfResources simply not true... |
| Posted by: | "Jolyon Smith" (jsmi..@deltics.co.nz) |
| Date: | Fri, 7 Sep 2007 23:02:16 +1200 |
... when the control associated with your Canvas.Handle itself has an invalid
window handle.
TWinControl.GetDeviceContext() raises an EOutOfResources if it fails to obtain
a HDC for the HWND. It doesn't raise the last OS error, as it should do, it
just assumes that resources have been exhausted. Yuck.
This has been a Public Service Announcement on behalf of me : Discovering this
nugget cost me a night and part of an early morning - maybe I can save someone
the same pain.
For anyone interest in the gruesome details of how I came to uncover this,
I've blogged on the subject at my recently initiated, and still evolving, site
www.deltics.co.nz
--
Jolyon Smith
www.deltics.co.nz