PDA

View Full Version : Setting font is crashing the application



shona155
12-28-2014, 11:41 PM
Hi All,


I am using mfc and stinggray for my application and setting the font as shown below, but my application crashes when it reaches m_Edit.SetFont( pPC->pFont ).

LvPaintContext* pPC;
pPC = CreatePaintContext(&dc);
CString str = SECListCtrl::GetItemText( iItem, iCol );
m_Edit.SetWindowText( str );
m_Edit.SetValue(GetPaid(GetItemAt(iItem)).getDoubl e());

pPC->lvi.iItem = iItem;
pPC->lvi.iSubItem = iCol;
pPC->lvi.state = 0;
VERIFY(LoadPaintContext(pPC));
m_Edit.SetFont( pPC->pFont );
m_Edit.SetSel(0, -1);
m_Edit.ShowWindow(SW_SHOW);
m_Edit.SetFocus();
m_bDidProcessAndDestroyEditLabel=FALSE;
m_strOldEditText=str;
delete pPC;