CXTPFramePaintManager::DrawFrame crash |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
Posted: 19 January 2009 at 9:28pm |
Hi
I'm getting occasional crashes in this func, where it's trying to draw an image, and the pointer is not NULL, but points to an object that has been deleted. E.g/. pImage = LoadImage(_T("FRAMEBOTTOMRIGHT")); if (pImage) { rcSrc = pImage->GetSource(bActive ? 0 : 1, 2); CRect rcBottomRight(rc.right - rcSrc.Width(), rc.bottom - rcSrc.Height(), rc.right, rc.bottom); pImage->DrawImage(pDC, rcBottomRight, rcSrc, CRect(0, 0, 0, 0), 0xFF00FF); } where pImage if you browse it is all 0xfeeefeee members. how could this be deleted and still returned from LoadImage? I'm using multiple frames with my app.... |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Do you have frames in multiple threads ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
Hi Oleg
yes, each frame has its own thread, else they don't work for things like updating UI etc. |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
p.s. this crash happened when I closed one of the frames.
it was running in the debugger. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Do you have common PaintManager or each frame's commandbars has its own ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
I don't manually set any paint manager on any frame - so whatever the default is.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Then try create individual PaintManager + its Images for separate frame:
pCommandBars->SetTheme(xtpThemeOffice2007);
((CXTPOffice2007Theme*)pCommandBars->GetPaintManager())->SetImages(pImages);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
Hi Oleg
Sorry - I misunderstood you. I do already call pCommandBars->SetTheme(xtpThemeRibbon) for each frame. I don't know where I should get pImages from though. They are all standard CodeJock resources - I don't have any images for the 2 items in the quick access toolbar. I do have a few icons for the ribbon I set though. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
The thing that now all PaintManagers share same CXTPOffice2007Image collection.
add variable for frame
CXTPOffice2007Images* m_pImages;
in constrcutor m_pImages = new CXTPOffice2007Images();
in destructor delete m_pImages
ans set for theme:
CXTPOffice2007Theme*)pCommandBars->GetPaintManager())->SetImages(m_pImages);
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
OK thanks, I'll try that.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |