Stack size

Sigbjorn Finne sof@galconn.com
Fri, 14 Sep 2001 12:13:01 -0700


Alastair David Reid <reid@cs.utah.edu> writes:
>
 ....
>   
> 
> As for why Hugs and the HGL are able to corrupt the entire screen on
> Win2000, I can only say that I am very impressed by MS's ability to
> put so much functionality into their system and have it ever work. :-)
> 

Well, I'm not terribly impressed by the Graphics library 1/2 ;-) You
absolutely have to release window DCs you grab via GetDC() to avoid
running out of resources -- this is Petzold-101 stuff. So, to avoid seeing
side-effects of running out of DCs, I suggest you change
GraphicsWND.drawWND to:

drawWND :: WND -> Draw () -> IO ()
drawWND wnd p = do
  hwnd <- getHWND wnd
  withDC (Just hwnd) (unDraw p)

hth
--sigbjorn