Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPTabControl Dynamic Window
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTabControl Dynamic Window

 Post Reply Post Reply
Author
Message
cgaskill View Drop Down
Newbie
Newbie


Joined: 13 April 2006
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote cgaskill Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTabControl Dynamic Window
    Posted: 13 April 2006 at 7:29pm

I have a project that will create a tab for each DLL that is associated to it.  I create the tab via InsertItem but leave the hwndClient parameter as NULL.  Then when the user clicks on a tab I want to load the DLL library, create the window, and so it to the user.  I can load the library, create the window, and associate the new window to the specific tab via the SetHandle method on the CXTPTabManagerItem class.  However, the SetSelectedItem method of CXTPTabControl gets the child window via (GetHandle) before it notifies the parent that the user selected a new tab.  So the tab doesn't show the window.  Since the m_hwndClient variable of CXTPTabControl is only set in the SetSelectedItem method there is no way to set this other than clicking on another tab then clicking back to see the window.  Not what we want the user to have to do.  Since the variable m_hwndClient is private I can't subclass CXTPTabControl to provide my own implementation for the virtual method SetSelectedItem.  My work around is after I have created the new window I call SetSelectedItem(NULL), then SetSelectedItem(pTabItem) (where pTabItem as retrieve from a previous call to GetSelectedItem) to force it to draw properly.

Is this the only way to accomplish this or am I missing something?

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: 13 April 2006 at 7:59pm

hi,

SetSelectedItem is virtual method, you can just override it and set handle before paret class call.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
cgaskill View Drop Down
Newbie
Newbie


Joined: 13 April 2006
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote cgaskill Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2006 at 8:31am
I tried that.  I was going to send the notification that the selection had changed first (which would allow the parent to call the SetHandle with the new window) then set the internal variable m_hwndClient as it currently does; however, the hwndClient variable is private so I can't access it.
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.061 seconds.