Print Page | Close Window

Grid Chrashes in OnInplaceBtnDown

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=151
Printed Date: 06 May 2024 at 5:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Grid Chrashes in OnInplaceBtnDown
Posted By: mgampi
Subject: Grid Chrashes in OnInplaceBtnDown
Date Posted: 06 September 2003 at 8:12am

Hi;

I've created a property grid control inside a XTDockWindow within a MDI application. The grid recreates its contents every time the user selects a different document type to reflect the available properties. But this behavour is not responible for the below mentioned ACCVIO.

When clicking on the in-place button of a CXTPropertyGridItemColor item type the app crashes inside the OnInplaceBtnDown message handler of the CXTPropertyGridItemColor class. I found out that after calling CColorDialog dlg.DoModal() methode the class members seems to be corrupted. So the m_Grid member of the class points to 0xfdfdfdfd just after the return from DOModal().

First I thought that the app runs out of stack space because the dialog object is created on stack, so I doubled the available stack size by increasing the stack parameters on the linker page of the compiler (VC++ 6.0 SP4). But the result is still the same. In all of the sample apps, everything works fine. I checked my solution to create the grid inside the docking window with similar samples and I can't find the difference!

Does anyone know what I'm doing wrong?

Thanxs in advance

Martin




Replies:
Posted By: Oleg
Date Posted: 07 September 2003 at 7:04am

Hello, Martin

I suppose that you call ResetContent of property grid

in the CView::OnActivateView  that called after dialog become visible.  so item is destroyed after

CColorDialog dlg.DoModal()  method.

 

 



Posted By: mgampi
Date Posted: 09 September 2003 at 8:35am

You're absolutely right!

I made the mistake to reset the content of the property grid each time the view was activated/deactivated in OnActivateView.

I fixed it and now it works as expected.

Thanks

Martin




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