正在加载图片...
VC++ Programming UESTC Chapter 5 The Graphics Device Interface Color and Fonts Properly handle cdc object to release the windows resource Construct object object the stack void CMy View: OnLButton Down qUiNT nFlags Cpoint point) CRect rect CClientDC dc(this); / from stack dc. GetClipBox(rect):i//dc automatically released 2. Use CWnd: GetDC….. OnlButtondown(….){ Crect rect CDC* pDC= GetDCO ReleaseD(pDc); 3. You must not to destroy Cdc object passed by OnDraw. Let framework does it for youVC++ Programming @ UESTC 8 ⚫ Properly handle CDC object to release the windows resource. 1. Construct object object the stack void CMyView::OnLButtonDown(UINT nFlags, Cpoint point) { CRect rect; CClientDC dc(this); // from stack dc.GetClipBox(rect); }// dc automatically released 2. Use CWnd::GetDC ….. OnLButtonDown(….) { Crect rect; CDC* pDC = GetDC(); …. ReleaseDC(pDC); } 3. You must not to destroy CDC object passed by OnDraw. Let framework does it for you. Chapter 5 The Graphics Device Interface , Color and Fonts
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有