Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtGridWnd Collapse All
Subject Author Date
tarou iiyama Oct 24, 2005 - 3:33 AM

  Hi


 pCellHeaderAtLeft becomes Null.
I am troubled.


-----------------------------------------------------
header
-----------------------------------------------------
class MT_EXPORT CPvGridView : public CExtGridWnd



-----------------------------------------------------
cpp
-----------------------------------------------------
void CPvGridView::MakeView( CString csJyouken )
{


    SiwModifyStyle(
        __ESIS_STH_PIXEL|__ESIS_STV_ITEM
            |__EGBS_SFM_FULL_ROWS|__EGBS_SF_SELECT_OUTER_ROWS
            |__EGBS_RESIZING_CELLS_OUTER|__EGBS_DYNAMIC_RESIZING_H
            |__EGBS_MULTI_AREA_SELECTION|__EGBS_NO_HIDE_SELECTION
            |__EGBS_GRIDLINES_V|__EGBS_LBEXT_SELECTION|__EGBS_SUBTRACT_SEL_AREAS
        ,
        0,
        false
        );
    SiwModifyStyleEx(
        __EGBS_EX_HVI_EVENT_CELLS
        |__EGBS_EX_HVO_EVENT_CELLS
            |__EGBS_EX_HVI_HIGHLIGHT_ROWS
            |__EGBS_EX_HVO_HIGHLIGHT_ROWS
            |__EGBS_EX_SI_HIGHLIGHT_ROWS
            |__EGBS_EX_SO_HIGHLIGHT_ROWS
        |__EGBS_EX_CELL_TOOLTIPS_OUTER|__EGBS_EX_CELL_EXPANDING_INNER
            |__EGBS_EX_CORNER_AREAS_3D|__EGBS_EX_CORNER_AREAS_CURVE
        ,
        0,
        false
        );
    BseModifyStyle(
        __EGWS_BSE_SORT_MULTIPLE_COLUMNS,
        __EGWS_BSE_DEFAULT,
        false
        );
    BseModifyStyleEx(
        __EGBS_BSE_EX_DRAG_COLUMNS
            |__EGBS_BSE_EX_HIGHLIGHT_PRESSING_COLUMNS_OUTER
            |__EGBS_BSE_EX_HIGHLIGHT_PRESSING_STAY_COLUMNS,
        __EGWS_BSE_EX_DEFAULT,
        false
        );


    RowRemoveAll( false );
    ColumnRemoveAll( false );
    OuterRowCountTopSet( 1L, false );
    OuterColumnCountLeftSet( 1L, false );
    OuterColumnCountRightSet( 1L, false );
    OuterColumnWidthSet( true, 0L, 60 );
    OuterColumnWidthSet( false, 0L, 14 );
    LONG nColCount = sizeof(g_arrHdrNames) / sizeof(g_arrHdrNames[0]);


    ColumnAdd( nColCount, false );


    for( LONG nColNo = 0L; nColNo < nColCount; nColNo++ )
    {
        CExtGridCellHeader * pCell =
            STATIC_DOWNCAST(
                CExtGridCellHeader,
                GridCellGetOuterAtTop(
                    nColNo,
                    0L,
                    RUNTIME_CLASS(CExtGridCellHeader)
                    )
                );
        pCell->ExtentSet( g_arrHdrExtents[nColNo] );
        pCell->TextSet( g_arrHdrNames[nColNo] );
        //pCell->IconIndexSet( g_arrHdrIconIndexes[nColNo] );
    } // for( LONG nColNo = 0L; nColNo < nColCount; nColNo++ )
   
    ModifyStyle( 0, WS_CLIPCHILDREN | WS_CLIPSIBLINGS );
    OnSwUpdateScrollBars();
    OnSwDoRedraw();


    RowAdd( 1L, false );
    int nRowNo = 0;


    CExtGridCellHeader * pCellHeaderAtLeft =
        STATIC_DOWNCAST(
            CExtGridCellHeader,
            GridCellGetOuterAtLeft(
                0L,
                nRowNo,
                RUNTIME_CLASS(CExtGridCellHeader)
                )

            );
    ASSERT_VALID( pCellHeaderAtLeft );


-----------------------------------------------------
Create  


-----------------------------------------------------



    CWnd * pParentWnd = m_wndTab.GetParent();
    UINT nID          = m_wndTab.GetDlgCtrlID();
    DWORD   dw = AFX_WS_DEFAULT_VIEW;
    if ( !m_wndTabContainer->Create(
                pParentWnd,
                CRect( 0,0,100,100 ),
                nID,
                WS_CHILD|WS_VISIBLE,
                NULL
                )
       )
    {
        TRACE0("Failed to create view window\n");
        return -1;
    }
    m_wndTab.SetParent( m_wndTabContainer );
    m_wndTabContainer->ModifyStyle( 0, WS_CLIPCHILDREN | WS_CLIPSIBLINGS );

Technical Support Oct 24, 2005 - 10:48 AM

Your code is correct, we tested it and found no problems. The pCellHeaderAtLeft is always valid. Could you send us a test project that demonstrates the problem.

tarou iiyama Oct 26, 2005 - 2:25 AM

Thank you 


 m(__)m