Print Page | Close Window

How to use CXTPTabClientWnd correctly!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1204
Printed Date: 06 November 2025 at 4:34pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use CXTPTabClientWnd correctly!
Posted By: xred
Subject: How to use CXTPTabClientWnd correctly!
Date Posted: 25 September 2004 at 12:53am

I found  some examples work very well,but my not!

////////////////////////////
 CXTPTabClientWnd m_MTIClientWnd;
///////////////////////////
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
 ....

 VERIFY(m_MTIClientWnd.Attach(this));
 
 ....

}
///////////////////////////

Thanks in advance!




Replies:
Posted By: Oleg
Date Posted: 25 September 2004 at 2:19pm

You can create child like this:

BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
 // make sure view is maximum size to eliminate
 // flicker when switching tabs.
 cs.x =
 cs.y = 0;
 
 cs.cx =
 cs.cy = 32767;
 
 // TODO: Modify the Window class or styles here by modifying
 //  the CREATESTRUCT cs

 if( !CMDIChildWnd::PreCreateWindow(cs) )
  return FALSE;

 return TRUE;
}



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: xred
Date Posted: 26 September 2004 at 5:29am

Hi,Oleg I have to say that it doesn't work!

However some examples such as GUI_Visualstudio7 don't include these lines ,but it works very well!

Why?



Posted By: Oleg
Date Posted: 26 September 2004 at 10:59am

 Additional add

void CChildFrame::ActivateFrame(int nCmdShow)
{
 // first window should be maximized
 if (GetParent()->GetWindow(GW_CHILD) == this)
 {
  nCmdShow = SW_SHOWMAXIMIZED;
 }
 
 CMDIChildWnd::ActivateFrame(nCmdShow);
}

to make it Maximized by default.

 

In  GUI_Visualstudio7  .Attach called with bEnableGroups = TRUE

VERIFY(m_MTIClientWnd.Attach(this, TRUE));


 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: xred
Date Posted: 27 September 2004 at 5:00am

Oleg ,It still cant't work!I'm in despair,I hit my keyboard, so my keyboard's space key has been broken yet!
However I found out some examples include this function ,and it seems to work!But there is flicker none the less,
and the flicker beacame lightly only!

//////////////////////////////////////////////////////////// //////////////
LRESULT CChildFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
 if (message == WM_NCPAINT)
 {
  // prevent caption blinking
  return TRUE;
 } 
 return CMDIChildWnd::WindowProc(message, wParam, lParam);
}
//////////////////////////////////////////////////////////// //////////////

I can't understand why GUI_VisualStudio7 didn't include any special line and It works so perfectly!
Is there a method to solve this problem?

//////////////////////////////////////////////////////////// /////////////
In my program:
CMainFrame:
 CXTPTabClientWnd m_MTIClientWnd;
 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 {
  ...
  VERIFY(m_MTIClientWnd.Attach(this));
  ...
 }
CChildFrame:
 BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
 {
  if( !CMDIChildWnd::PreCreateWindow(cs) )
   return FALSE;

  return TRUE;
 }
 void CChildFrame::ActivateFrame(int nCmdShow)
 {

  nCmdShow = SW_SHOWMAXIMIZED;
  CMDIChildWnd::ActivateFrame(nCmdShow);
 }
 LRESULT CChildFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
 {
  if (message == WM_NCPAINT)
  {
   // prevent caption blinking
   return TRUE;
  } 
  return CMDIChildWnd::WindowProc(message, wParam, lParam);
 }

Thank you again,Oleg!



Posted By: SuperMario
Date Posted: 27 September 2004 at 11:20am
In previous post, Oleg mentioned that the VS 7 sample used this:

    VERIFY(m_MTIClientWnd.Attach(this, TRUE));

I see in your code that you are do this:
    VERIFY(m_MTIClientWnd.Attach(this));

I tried both version in the VS 7 sample and removing "TRUE" produced results similar to the problem you are having.

Hope this help


Posted By: Oleg
Date Posted: 27 September 2004 at 11:59pm

add

cs.x =
 cs.y = 0;
 
 cs.cx =
 cs.cy = 32767;

to PrecreateWindow



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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