Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to save CXTPTabClientWnd state?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to save CXTPTabClientWnd state?

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


Joined: 19 March 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote sion Quote  Post ReplyReply Direct Link To This Post Topic: How to save CXTPTabClientWnd state?
    Posted: 24 March 2006 at 11:10am
HI~
When the application to be closed,How to save CXTPTabClientWnd state.
CXTPTabClientWnd::SaveState()?

Back to Top
sion View Drop Down
Newbie
Newbie


Joined: 19 March 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote sion Quote  Post ReplyReply Direct Link To This Post Posted: 02 April 2006 at 12:16pm

Help me please~
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: 03 April 2006 at 7:42am

SaveState saves only positon og Tabs. Where is no way for CXTPTabClientWnd  to save/restore actual window childs.

You must manually save childs and reopen in startup, CXTPTabClientWnd  will automatically create tabs for them.

Hint code:

 

void CMainFrame::OnClose()
{

 

  CWnd* pMDIClient = CWnd::FromHandle(m_hWndMDIClient);
  CChildFrame* pWnd = (CChildFrame*) pMDIClient->GetDlgItem(nIndex);

  while (pWnd)
  {
   CStylerView* pView = (CStylerView*)pWnd->GetActiveView();
   ASSERT(pView);   

   if (pView) strPopups += pView->GetDocument()->GetCurrentUrl() + ";";
   
   pWnd = (CChildFrame*) pMDIClient->GetDlgItem(++nIndex);
  }
  
  AfxGetApp()->WriteProfileString(_T("MainFrame "), _T("LastVisited"), strPopups);
  
 }

 CMDIFrameWnd::OnClose();
}

 

void CMainFrame::OpenLastVisited()
{
 CString strBuffer = AfxGetApp()->GetProfileString(_T("MainFrame"), _T("LastVisited"));
 
 if (!strBuffer.IsEmpty())
 {
  LPTSTR pBuffer = strBuffer.GetBuffer(0);
  
  TCHAR* token = _tcstok(pBuffer, _T(";"));  
  while (token)
  {
   OpenWindow(token);
   token = _tcstok( NULL, _T(";"));
  }  
 } 
}

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.047 seconds.