CDumpContext怎样使用?

来源:百度知道 编辑:UC知道 时间:2024/05/29 07:45:47
一楼的哥们,是否可以具体解释一下?3q

void CBCGPToolBar::Dump(CDumpContext& dc) const
{
CBCGPBaseToolBar::Dump (dc);

CString strName;

if (::IsWindow (m_hWnd))
{
GetWindowText (strName);
}

dc << "\n**** Toolbar ***" << strName;
dc << "\nButtons: " << m_Buttons.GetCount () << "\n";

dc.SetDepth (dc.GetDepth () + 1);

for (POSITION pos = m_Buttons.GetHeadPosition (); pos != NULL;)
{
CBCGPToolbarButton* pButton = (CBCGPToolbarButton*) m_Buttons.GetNext (pos);
ASSERT_VALID (pButton);

pButton->Dump (dc);
dc << "\n";
}

dc.SetDepth (dc.GetDepth () - 1);
dc << "\n";
}