![]() |
CXTPPRopertySheet and OnInitDialog |
Post Reply ![]() |
Author | |
gerrysweeney ![]() Newbie ![]() ![]() Joined: 27 May 2008 Location: United Kingdom Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 27 May 2008 at 11:56am |
I have used CXTPPropertySheet/CXTPPropertyPage instead of the standard MFC provided ones to get the alternative navigation schemes. This works OK for me except for one issue: - When a CXTPPropertySheet is created (using DoModal()) each CXTPPropertyPage is created and its related OnInitDialog() is invoked. In the standard CPropertySheet/CPropertyPage the OnInitDialog method is only invoked if you switch to that tab which is of course far more efficient. This would not cause a problem apart from the fact that some of the tabs need to do a bit of processing when they are first initialized. For example, we use a Property Sheet for our about dialog, and one of the tabs provides a list of all the applications loaded modules and their versions, which can take a good few seconds to load. With the MFC property sheet/page this loading would only occur if one clicks the "Loaded Modules" tab, but with the CXTPPropertySheet/Page implementation the whole dialog takes about 10 seconds to load and display, As the CXTPPropertySheet/Page classes are designed to be a *better* replacement for their MFC counterparts, I would say this is a bug? Any ideas on what I could do about this? Gerry |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Sorry, now you can't change it, it was designed to work this way. We will check if it possible to enhance it. Thanks.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
gerrysweeney ![]() Newbie ![]() ![]() Joined: 27 May 2008 Location: United Kingdom Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Hi Oleg, Thanks for the response. For those of you that care about this functionality in the meantime, here is a peice of code that resolves the issue, just derive your pages from CXTPPropertyPageEx instead of CXTPPropertyPage and place the following code in your stdafx.h/.cpp files (or stand-alone files if you like. Nothing interesting going on, I just sunk the WM_INITDIALOG message and invoke OnInitDialog() method from the OnSetActive() method... Perhaps the good folks at codejock will see their way to including this behavior in future library releases. Gerry n.b Just updated the code, I forgot a "OnSetActive" should not have been private
n.b Just updated to include a call to UpdateData() to ensure that controls that are DDX_ subclassed are subclassed even before the page is first displayed
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |