porting problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sivakumaran

    porting problem

    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.

  • Nishant Sivakumar

    #2
    Re: porting problem

    If that's part of the Stingray library, you'd be best off asking their
    technical support about this.

    --
    Regards,
    Nish [VC++ MVP]
    Nish’s thoughts on technology leadership, cloud architecture, and APIs, among other things




    "sivakumara n" <sivakumaran@di scussions.micro soft.com> wrote in message
    news:C4509714-8FB3-4B9C-8F90-EA47870C8D4D@mi crosoft.com...[color=blue]
    > 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.
    >[/color]


    Comment

    Working...