Results 1 to 3 of 3

Thread: DrawSubItem in SECTreeCtrl does not works in the Stringray Studio 11.0

  1. #1
    Junior Member
    Join Date
    Feb 2013

    Exclamation DrawSubItem in SECTreeCtrl does not works in the Stringray Studio 11.0

    We have migrated our visual studio project from 2005 to 2010. Our project source in 2005 is as follows and the same is not working in the 2010. We are using Stingray version 11.0 libraries.

    LvPaintContext* pPC in the DrawSubItem has some problem with respect to CDC object. I mean CDC object in the LvPaintContext is passed with NULL which is not allowing to customize the tree with color/font.

    CUxx_MS_TreeCtrl class is derived from SECTreeCtrl

    void CUxx_MS_TreeCtrl:rawSubItem(LvPaintContext* pPC)
    COLORREF txtColor = GetRGBColor(UXX_BLACK);
    if (pPC->lvi.iSubItem == 0)

    //Get our owner drawn data
    CString strText;
    int iImage;
    CRect rectText,rcIndent;

    BOOL bEditing = (pPC->lvi.iItem == m_nEditItem) && (pPC->iCol == m_nActiveColumn);

    TvPaintContext* pTvPC = dynamic_cast<TvPaintContext*>(pPC);
    BOOL bSelected = (pTvPC->tvi.state & TVIS_SELECTED) != 0;
    iImage = bSelected ? pTvPC->tvi.iSelectedImage : pTvPC->tvi.iImage;
    BOOL bHasImage = HasImage(&(pTvPC->tvi));
    strText = pPC->lvi.pszText;

    // Fill with background color
    CRect rectFill;
    CBrush brush(pPC->rgbItemBkgnd);

    rectFill = pPC->rect;
    int xOrigin = pPC->rect.left;
    // Compute text size and position
    rectText = pPC->pItem->rcText;
    rectText.left += xOrigin; += pPC->;
    rectText.right += xOrigin;
    rectText.bottom += pPC->;

    // If we have multiple columns, next columns clip the text of previous columns
    if ( GetColumnCount() > 1 || pPC->pdc->IsPrinting() )
    rectText.right = pPC->rect.right - SEC_RIGHT_OFFSET;


    We have observed CDC object under LvPaintContext *pPC is not creating properly.
    Can some one help me in resolving the issue.
    Last edited by Rajeshwar; 02-27-2013 at 04:43 AM.

  2. #2
    Join Date
    Mar 2008
    SECTreeCtrl problems with LvPaintContext are almost always caused by a Platform Targeting mismatch. The fact that you have changed build platform supports this.

    When you install Stingray Studio, the installer updates the file ...\Include\SupportedPlatforms.h to target the platform on which Stingray Studio is installed. The Stingray libraries are all built using this header file to control Platform Targeting. Previously, this was controlled by setting WINVER and _WIN32_WINNT either in code or in project settings. If you have these older targeting macros in your application, they are probably not set to the version of Windows on which Stingray Studio is installed.

    Please check that you do not have definitions for WINVER or _WIN32_WINNT anywhere in your code or project settings, then be sure to #include SupportedPlatforms.h in your stdafx.h file, preferably as the first included file. This will ensure that your application is built for the same platform as the Stingray libraries.

    Note that if you are a current customer, you can submit a support request at

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Thank you very much Terry. The problem got resolved by including SupportedPlatforms.h in the stdafx.h.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts