Pane Data & Layouts |
Post Reply |
Author | |
mrmathis
Senior Member Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
Post Options
Thanks(0)
Posted: 19 July 2007 at 10:40am |
I am using the CXTPDockingPane::GetPaneData/SetPaneData APIs to cache a pointer on each of my panes. I use the pointers during various operations and transitions in my app to help me get the right data in the windows attached to the panes. I recently started using CXTPDockingPaneLayout to save and restore my docking pane arrangement during some of my app's transitions. This might be in a single session, or in subsequent invocations of my app. I had a few surprises.
First, the panes themselves are actually destroyed and recreated when a layout is applied, with the attached child windows transferring to the new pane. I had assumed that the panes would simply reposition. My question is whether this will cause any undue "flashing" on the screen if, for example, a pane or three doesn't really have to move around from one layout to another? My biggest problem, though, is that the layout stores the pane's m_dwData value to the registry under the name "Tag" and restores that value when the layout is applied. Since that value is a pointer for me, that doesn't work out too well, especially in separate sessions. To be clear, here is what I see: I create some panes as my app initializes, caching my pointers to dynamically determined data. Later I load and apply a layout, and my cached pointers are overwritten with the value stored in the layout. The next time I attempted to de-reference the pointer, I crash. Is there any (easy) way to avoid or override this behavior? I would really rather not get in the middle of all the Clone and Copy calls bouncing around in this operation. --Mike |
|
--Mike
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Just don't use it this way.
Create some internal CMap to map id to you pointer.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mrmathis
Senior Member Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
Post Options
Thanks(0)
|
Well, I did find a way to cache my data elsewhere in my app, but I would appreciate some background into why Codejock works this way. Am I using the pane data in some way other than it is intended? What is the intended purpose of this data? I have used, for example, the similar item-data concept on generic Win32 tree controls items for many years as a convenient place to cache pointers.
Also, what about the flashing? I do see all panes flash if I successively apply layouts that, say, differ only by a single window position. |
|
--Mike
|
|
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 |