One of my applications is built with VC 6.0.
I planned to move the existing code to .NET. As the first step I just wanted
to build the existing code without any modifications (Unmanaged code) with VC
7.1 compiler.
We used Microsoft Studio .NET 2003 to do that.
Our application uses one of the third party library (Stingray). So we
rebuilt the Stingray
Studio 2004 too with .NET compiler.
Everything is fine as of now.
But the running instance is crashing at the following piece of code
What could be the problem?
void CUxx_MS_TreeCtr l::DrawSubItem( LvPaintContext* pPC)
{
//fnTrc fn_name ( "CUxx_MS_TreeCt rl::DrawSubItem ", TRC_CYCTIME );
COLORREF txtColor = GetRGBColor(UXX _BLACK);
if (pPC->lvi.iSubItem == 0)
{
//Get our owner drawn data
CString strText;
int iImage;
CRect rectText;
CRect rcIndent;
BOOL bEditing = (pPC->lvi.iItem == m_nEditItem) && (pPC->iCol ==
m_nActiveColumn );
TvPaintContext* pTvPC = (TvPaintContext *)pPC;
BOOL bSelected = (pTvPC->tvi.state & TVIS_SELECTED) != 0;
iImage = bSelected ? pTvPC->tvi.iSelectedI mage : pTvPC->tvi.iImage;
BOOL bHasImage = HasImage(&(pTvP C->tvi));
strText = pTvPC->tvi.pszText;
...
…
….
}
It says the pszText notified by the arrow as Bad pointer.
I planned to move the existing code to .NET. As the first step I just wanted
to build the existing code without any modifications (Unmanaged code) with VC
7.1 compiler.
We used Microsoft Studio .NET 2003 to do that.
Our application uses one of the third party library (Stingray). So we
rebuilt the Stingray
Studio 2004 too with .NET compiler.
Everything is fine as of now.
But the running instance is crashing at the following piece of code
What could be the problem?
void CUxx_MS_TreeCtr l::DrawSubItem( LvPaintContext* pPC)
{
//fnTrc fn_name ( "CUxx_MS_TreeCt rl::DrawSubItem ", TRC_CYCTIME );
COLORREF txtColor = GetRGBColor(UXX _BLACK);
if (pPC->lvi.iSubItem == 0)
{
//Get our owner drawn data
CString strText;
int iImage;
CRect rectText;
CRect rcIndent;
BOOL bEditing = (pPC->lvi.iItem == m_nEditItem) && (pPC->iCol ==
m_nActiveColumn );
TvPaintContext* pTvPC = (TvPaintContext *)pPC;
BOOL bSelected = (pTvPC->tvi.state & TVIS_SELECTED) != 0;
iImage = bSelected ? pTvPC->tvi.iSelectedI mage : pTvPC->tvi.iImage;
BOOL bHasImage = HasImage(&(pTvP C->tvi));
strText = pTvPC->tvi.pszText;
...
…
….
}
It says the pszText notified by the arrow as Bad pointer.
Comment