Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Crash when moving from 19.1 to 19.2
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Crash when moving from 19.1 to 19.2

 Post Reply Post Reply
Author
Message
pjna View Drop Down
Newbie
Newbie


Joined: 30 January 2014
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote pjna Quote  Post ReplyReply Direct Link To This Post Topic: Crash when moving from 19.1 to 19.2
    Posted: 17 July 2020 at 9:19am
Just picking up the 19.2.0 update and integrating it into a number of applications I manage, and I am getting a consistent crash in all the applications which use it. I am creating a property grid control in my application with standard code which has been there for many years:

        if (!m_wndPropertyGrid.Create(CRect(0, 0, 10, 10), this, 101))
        {
            TRACE(_T("Failed to create property grid control window\n"));
            return;
        }
        m_wndPropertyGrid.ShowToolBar(FALSE);
        ...

and I am now getting a crash down in the bowels of CJ Toolkit Pro 19.2:

CXTPPropertyGridView& CXTPPropertyGrid::GetGridView() const
{
    if (NULL == m_pView)
    {
        m_pView             = CreateView();
        m_pView->m_pGrid = (CXTPPropertyGrid*)this;
    }

    CXTPScrollablePropertyGridListBox* pScrollableView =
        DYNAMIC_DOWNCAST(CXTPScrollablePropertyGridListBox, m_pView);
    if (NULL != m_pView)
    {
        CXTPPropertyGridView* pEmbeddedView = DYNAMIC_DOWNCAST(CXTPPropertyGridView,
                                                               pScrollableView->GetControl());
        if (NULL != pEmbeddedView)
        {
            return *pEmbeddedView;
        }
    }

    return *m_pView;
}

pScrollableView is a null pointer in the above code and then the code attempts a call to pScrollableView->GetControl and promptly crashes. The call stack I have is as follows:

     ToolkitPro1920vc160x64D.dll!CXTPScrollHost::GetEmbeddedControl() Line 90    C++
     ToolkitPro1920vc160x64D.dll!CXTPScrollablePropertyGridListBox::GetControl() Line 96    C++
>    ToolkitPro1920vc160x64D.dll!CXTPPropertyGrid::GetGridView() Line 358    C++
     ToolkitPro1920vc160x64D.dll!CXTPPropertyGrid::OnSize(unsigned int nType, int cx, int cy) Line 890    C++
     mfc140d.dll!CWnd::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 2493    C++
     ToolkitPro1920vc160x64D.dll!CXTPPropertyGrid::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 1849    C++
     mfc140d.dll!CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2099    C++
     mfc140d.dll!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 265    C++
     mfc140d.dll!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 418    C++
     mfc140d.dll!AfxWndProcBase(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 299    C++
     user32.dll!UserCallWinProcCheckWow()    Unknown
     user32.dll!DispatchClientMessage()    Unknown
     user32.dll!__fnDWORD()    Unknown
     ntdll.dll!00007ffd1c0bfde4()    Unknown
     win32u.dll!0000023c50c21f24()    Unknown
     user32.dll!VerNtUserCreateWindowEx()    Unknown
     user32.dll!CreateWindowInternal()    Unknown
     user32.dll!CreateWindowExA()    Unknown
     mfc140d.dll!IsolationAwareCreateWindowExA(unsigned long dwExStyle, const char * lpClassName, const char * lpWindowName, unsigned long dwStyle, int X, int Y, int nWidth, int nHeight, HWND__ * hWndParent, HMENU__ * hMenu, HINSTANCE__ * hInstance, void * lpParam) Line 419    C++
     mfc140d.dll!CWnd::CreateEx(unsigned long dwExStyle, const char * lpszClassName, const char * lpszWindowName, unsigned long dwStyle, int x, int y, int nWidth, int nHeight, HWND__ * hWndParent, HMENU__ * nIDorHMenu, void * lpParam) Line 727    C++
     mfc140d.dll!CWnd::CreateEx(unsigned long dwExStyle, const char * lpszClassName, const char * lpszWindowName, unsigned long dwStyle, const tagRECT & rect, CWnd * pParentWnd, unsigned int nID, void * lpParam) Line 694    C++
     ToolkitPro1920vc160x64D.dll!CXTPPropertyGrid::Create(const tagRECT & rect, CWnd * pParentWnd, unsigned int nID, unsigned long dwListStyle) Line 459    C++
     internal-astrex-database-manager.exe!CNDEDataPropertyGridFormView::CreatePropertyGrid() Line 487    C++

I have also tried rebuilding 19.2.0 with the new XTP_SKINFRAMEWORK_USE_LEGACY_API_HOOK preprocessor macro but get the same crash.

This looks like some issue introduced in the new 19.2.0 release. BTW, I have tried the PropertyGrid -> GridSample sample but there are no crashes there.

Is there some extra initialization or setup code which I need to avoid this issue?

Any ideas?
Back to Top
pjna View Drop Down
Newbie
Newbie


Joined: 30 January 2014
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote pjna Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2020 at 11:05am
Please ignore this bug report. What I had done was override CXTPPropertyGrid::CreateView in my code and what you now return in v19.2 has new requirements compared to v19.1. If I take this logic out of my code then the property grid is created without problem now. Sorry for the noise.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.