gdi.h
资源名称:propgrid.zip [点击查看]
上传用户:yangzi5763
上传日期:2007-01-02
资源大小:239k
文件大小:1k
源码类别:
ActiveX/DCOM/ATL
开发平台:
Visual C++
- #ifndef _GDINODESTACK
- #define _GDINODESTACK
- #include "stdafx.h"
- #include <afxtempl.h>
- struct CGdiNodeStack
- {
- CDC* m_pDC;
- CGdiObject* m_pGdiObject;
- CGdiObject* m_pSelectObject;
- CGdiNodeStack(CDC* pDC, CGdiObject* pGdiObject)
- {
- m_pDC = pDC;
- m_pGdiObject = pGdiObject;
- m_pSelectObject = m_pDC->SelectObject(m_pGdiObject);
- }
- ~CGdiNodeStack()
- {
- m_pDC->SelectObject(m_pSelectObject);
- }
- };
- struct CGdiStack : public CList<CGdiNodeStack*, CGdiNodeStack*>
- {
- void Push(CDC* pDC, CGdiObject* pGdiObject)
- {
- AddTail(new CGdiNodeStack(pDC, pGdiObject));
- }
- void Pop()
- {
- CGdiNodeStack* p = RemoveTail();
- delete p;
- }
- };
- #endif //_GDINODESTACK