Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Crash in a multi-thread UI app.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Crash in a multi-thread UI app.

 Post Reply Post Reply
Author
Message
jeffcmj View Drop Down
Groupie
Groupie


Joined: 28 October 2004
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffcmj Quote  Post ReplyReply Direct Link To This Post Topic: Crash in a multi-thread UI app.
    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



Edited by jeffcmj
Back to Top
jeffcmj View Drop Down
Groupie
Groupie


Joined: 28 October 2004
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffcmj Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ICBM View Drop Down
Groupie
Groupie


Joined: 15 January 2004
Location: New Zealand
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote ICBM Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.031 seconds.