Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Pane Data & Layouts
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Pane Data & Layouts

 Post Reply Post Reply
Author
Message
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Topic: Pane Data & Layouts
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 20 July 2007 at 2:52am
Hi,
Just don't use it this way.
Create some internal CMap to map id to you pointer.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2007 at 9:56am
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
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.152 seconds.