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 Creation Problem Collapse All
Subject Author Date
Mediatime Conseil Feb 9, 2010 - 1:40 AM

Hi,

I am using a CExtGridWnd derived class and it was working very well on profuis 2.83
I upgrade to 2.85 and now I have a creation error : Warning: Window creation failed: GetLastError returns 0x00000579, and it throws an exception.

The error code means "invalid menu handle"?

I tryed to use directly the class CExtGridWnd and I have the same problem

My code is like this :

//In the header file
CExtGridWnd m_DataGrid;

//In the OnInitDialog
m_DataGrid.Create(this, rect_format_list, IDC_FORMAT_LIST,0,WS_BORDER );

The error occurs in the :
BOOL CExtScrollItemWnd::Create(
    CWnd * pParentWnd,
    const RECT & rcWnd, // = CRect( 0, 0, 0, 0 )
    UINT nDlgCtrlID, // = UINT( __EXT_MFC_IDC_STATIC )
    DWORD dwScrollItemWndStyle, // = 0L
    DWORD dwWindowStyle, // = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
    CCreateContext * pContext // = NULL
    )
{
    ASSERT_VALID( this );
    pContext;
    if( ! RegisterScrollItemWndClass() )
    {
        ASSERT( FALSE );
        return FALSE;
    }
    m_bDirectCreateCall = true;
    m_dwScrollItemWndStyle = dwScrollItemWndStyle;
    if( ! CWnd::CreateEx( 0L, __EXT_SCROLLITEMWND_CLASS_NAME, _T(""), dwWindowStyle, rcWnd, pParentWnd, nDlgCtrlID ) )
    {

HERE THE CREATEEX FAIL

Thank you

Technical Support Feb 9, 2010 - 7:45 AM

The problem is in the following line of code:

m_DataGrid.Create(this, rect_format_list, IDC_FORMAT_LIST,0,WS_BORDER );

It should be:
m_DataGrid.Create(this, rect_format_list, IDC_FORMAT_LIST,0,WS_CHILD|WS_BORDER );

Or may be:
m_DataGrid.Create(this, rect_format_list, IDC_FORMAT_LIST,0,WS_CHILD|WS_VISIBLE|WS_BORDER );