Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPPropertySheet GetPage problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPPropertySheet GetPage problem

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

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Topic: CXTPPropertySheet GetPage problem
    Posted: 15 October 2009 at 10:41pm
I have an application wich uses GetPage in the MainSheet initdialog and it worked before the latest VS 2008 updates and now it always returns null :(

CPage1* page1 = (CPage1*) this->GetPage(0);

Is there any incompatibility between CJ toolkit and the latest VS 2008 updates ?
 
 
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
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: 16 October 2009 at 5:30am
Hi,
 
Difficult to say without sample to debug.   check what value returns GetPageCount();
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 16 October 2009 at 1:56pm
GetPageCount returns 8 because I have 8 pages, I call the GetPage function in OnInitDialog of the CXTPropertySheet
The code worked before the latest VS 2008 service pack, and now it returns a 0x000000 pointer
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 17 October 2009 at 11:10pm

int i=this->GetPageCount(); // this returns 8 in my application and 5 in tabmanager

CXTPPropertyPage* prop=this->GetPage(0); // this returns a valid page

CXTPPropertyPage* prop2=this->GetPage(1); // this returns 0x0000000 (null hwnd)

Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 17 October 2009 at 11:16pm
I have modified the TabManager sample so that you can see the problem in PropertiesDialog.cpp  -> CPropertiesDialog::OnInitDialog()
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
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: 18 October 2009 at 1:33am

Hello,

It returns valid pointer for me. only window for this page is not created. Is it your case too ?
 
its actually feature of 13.1 release - we made it mork same as standard PropetySheet - Page now created only when user fuirst select it. It will increase perfomance when you have some Sheet with f.e 20 pages.
 
as solution you can call CreatePage(prop2); to be sure it is created now.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
evoX View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 July 2007
Status: Offline
Points: 207
Post Options Post Options   Thanks (0) Thanks(0)   Quote evoX Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2009 at 10:44am
Hi,
   I don't care about the window, but I have variables in each page which caused a crash when I called UpdateData(FALSE);
   Now with CreatePage() works !!! thank you !
 

CPage2FileDisk* pageFileDisk=(CPage2FileDisk*)this->GetPage(1);

pageFileDisk->m_bDelCustomFiles=theApp.GetProfileInt(_T("Items"),_T("DelCustomFiles"),FALSE);

pageFileDisk->UpdateData(FALSE); // This caused a crash
 
now if I add before a CreatePage it does not crash anymore
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)
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.063 seconds.