Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - MFC assertion after skin change (force black text)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MFC assertion after skin change (force black text)

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


Joined: 08 January 2021
Location: São Paulo
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote pvdhouten Quote  Post ReplyReply Direct Link To This Post Topic: MFC assertion after skin change (force black text)
    Posted: 11 February 2021 at 3:06pm
Hello,

This is my first question posted on this forum.

I encounter an debug exception in MFC code after I change the skin of my application.
The application has lots of existing MFC components and I added a ribbon bar and docking pane manager to an MDI MainFrame.

The call stack leads to MFC code CControlBar::OnCtlColor with comments "force black text on gray background all the time". Inside CWnd::GrayCtlColor exists a verify assertion that fails:

VERIFY(::GetObject(hbrGray, sizeof(LOGBRUSH), (LPVOID)&logbrush));

The call stack after the skin change:

CWnd::GrayCtlColor(HDC__ * hDC, HWND__ * hWnd, unsigned int nCtlColor, HBRUSH__ * hbrGray, unsigned long clrText) Line 4356
CControlBar::OnCtlColor(CDC * pDC, CWnd * pWnd, unsigned int nCtlColor) Line 686
CWnd::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 2341
CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2087
CControlBar::WindowProc(unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 506
CWnd::OnNTCtlColor(unsigned __int64 wParam, __int64 lParam) Line 1528
CWnd::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 2383
CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2087
CControlBar::WindowProc(unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 506
AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 257
AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 420
  [External Code]
CXTPSkinManagerDetoursApiHook::OnHookDefDlgProcW(HWND__ * hWnd, unsigned int Msg, unsigned __int64 wParam, __int64 lParam) Line 1133
...
...
...
CXTPSkinManager::OnSkinChanged(int bPrevState, int bNewState) Line 1118

I am posting this question because I do not see any of our own code involved.
Do you have any idea what I might be doing wrong, or how I can continue to investigate (if it is a serious issue)? 

MFC version 10 (of toolkit v100 of Visual Studio 2010)
ToolKit Pro MFC: 19.3.0

Kind regards,
Peter


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.125 seconds.