Print Page | Close Window

Crash in a multi-thread UI app.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2067
Printed Date: 06 November 2025 at 5:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Crash in a multi-thread UI app.
Posted By: jeffcmj
Subject: Crash in a multi-thread UI app.
Date Posted: 01 April 2005 at 11:14am

I got a assert fail in a multi-thread app. There is one mainframe in one thread.

In XTPPaintManager::DrawControl
...
if (pEdit && pEdit->GetSafeHwnd() && pEdit->GetFont()!= &m_fontIcon)
...

Caused a Assert Fail. I think it's because m_fontIcon is static. Anyway to solve this problem?

Thanks




Replies:
Posted By: jeffcmj
Date Posted: 01 April 2005 at 12:22pm
The official sample MSDI also has this problem. If I change a toolbar button to Combobox with Edit embeded, the same crash will happen.


Posted By: ICBM
Date Posted: 04 April 2005 at 4:44pm

<Disclaimer: I have not read the source code that you say is at fault>

My thoughts would be, why are you performing gui updates on a different thread? This is 'not allowed'. Sometimes you can get away with it, but most often not. Only the thread that owns the window should do any kind of updates.



Posted By: Oleg
Date Posted: 06 April 2005 at 10:35am

In last 2 versions m_fontIcon is not static member (you can fix it in your sources)

+ you must use own paintmanager for each commandbars:

if (!InitCommandBars())
  return -1;

CXTPCommandBars* pCommandBars = GetCommandBars();

pCommandBars->SetPaintManager(CXTPPaintManager::CreateThe me(xtpThemeOfficeXP));



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net