RE: Mysterious CTD on method call.
I think I must be doing something wrong in my use of composition.
Basically, I have an object CduLinePair, has in its .h:
CduLineItem m_Label1, m_Label2;
CduLineItem m_Data1, m_Data2;
and in an object NavIndexPage, I do this:
CduLinePair *m_pLS1L; // in the .h
m_pLS1L->ClearLinePair();
or
m_pLS1L->SetData1(L"NAV IDENT", &CduLineItem::LargeFont,
&CduLineItem::brushTxtGold);
but these calls result in crashes (of course the functions are declared and
defined).
Both of those methods invoke CduLineItem methods that then attempt to set
public and private attributes, but result in a crash.
Like:
void CduLineItem::ClearItem()
{
//m_Text.clear();
//m_isBoxed = false;
//m_TextSize.Width = 0;
//m_TextSize.Height = 0;
}
or
void CduLinePair::SetData1(const wstring data, Font* pFont, SolidBrush*
pBrush)
{
m_Data1.m_Text = data;
m_Data1.SetFont(pFont);
m_Data1.SetColor(pBrush);
}
So, I must be doing something wrong or not doing something.