<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : CXTPPRopertySheet and OnInitDialog</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTPPRopertySheet and OnInitDialog]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 17:21:06 +0000</pubDate>
  <lastBuildDate>Tue, 27 May 2008 12:51:36 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=10799</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[CXTPPRopertySheet and OnInitDialog : Hi Oleg,   Thanks for the response....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10799&amp;PID=35883&amp;title=cxtppropertysheet-and-oninitdialog#35883</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4202">gerrysweeney</a><br /><strong>Subject:</strong> 10799<br /><strong>Posted:</strong> 27 May 2008 at 12:51pm<br /><br /><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">Hi Oleg, <?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P></O:P></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">Thanks for the response.&nbsp; 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...<O:P></O:P></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">Perhaps the good folks at codejock will see their way to including this behavior in future library releases. <O:P></O:P></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0cm 0cm 0pt" ="Ms&#111;normal"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">Gerry<O:P></O:P></SPAN></P><DIV>&nbsp;</DIV><DIV>n.b Just updated the code, I forgot a "OnSetActive" should not have been private</DIV><DIV>n.b Just updated to&nbsp;include a call to UpdateData() to&nbsp;ensure that controls that are DDX_ subclassed are&nbsp;subclassed even before the page is first&nbsp;displayed&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><table width="99%"><tr><td><pre class="BBcode">&nbsp;</DIV><DIV><DIV>///////////////////////////////////////////////////////////////////////////////////</DIV><DIV>// For stdafx.h</DIV></DIV><DIV>class CXTPPropertyPageEx : public CXTPPropertyPage<BR>{<BR>public:<BR>&nbsp;CXTPPropertyPageEx();<BR>&nbsp;CXTPPropertyPageEx(UINT nIDTemplate, UINT nIDCaption = 0);<BR>&nbsp;CXTPPropertyPageEx(LPCTSTR lpszTemplateName, UINT nIDCaption = 0);</DIV><DIV>// Implementation<BR>protected:<BR>&nbsp;DECLARE_MESSAGE_MAP()</DIV><DIV>&nbsp;virtual BOOL OnSetActive()<BR>&nbsp;{<BR>&nbsp;&nbsp;if(m_bInitUpdate)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;OnInitDialog();<BR>&nbsp;&nbsp;&nbsp;m_bInitUpdate = false;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return CXTPPropertyPage::OnSetActive();<BR>&nbsp;}</DIV><DIV>private:<BR>&nbsp;LRESULT OnInitDialogEx(WPARAM, LPARAM) </DIV><DIV>&nbsp;{</DIV><DIV>&nbsp; // Make sure that all DDX controls are sub-classed when the dialog is initialized<BR>&nbsp; // If not, when any of the sub-classed objects are accessed before the page is displayed MFC asserts (rightly)<BR>&nbsp;&nbsp;UpdateData(FALSE);<BR><BR>&nbsp;&nbsp;return 0;<BR>&nbsp;}</DIV><DIV>&nbsp;bool m_bInitUpdate;<BR>};</DIV><DIV>///////////////////////////////////////////////////////////////////////////////////</DIV><DIV>// For stdafx.cpp</DIV><DIV>CXTPPropertyPageEx::CXTPPropertyPageEx()<BR>{<BR>&nbsp;m_bInitUpdate = true;<BR>}</DIV><DIV>CXTPPropertyPageEx::CXTPPropertyPageEx(UINT nIDTemplate, UINT nIDCaption)<BR>&nbsp;: CXTPPropertyPage(nIDTemplate, nIDCaption)<BR>{<BR>&nbsp;m_bInitUpdate = true;<BR>}</DIV><DIV>CXTPPropertyPageEx::CXTPPropertyPageEx(LPCTSTR lpszTemplateName, UINT nIDCaption)<BR>&nbsp;: CXTPPropertyPage(lpszTemplateName, nIDCaption)<BR>{<BR>&nbsp;m_bInitUpdate = true;<BR>}</DIV><DIV>BEGIN_MESSAGE_MAP(CXTPPropertyPageEx, CXTPPropertyPage)<BR>&nbsp;//{{AFX_MSG_MAP(CXTPPropertyPageEx)<BR>&nbsp;ON_MESSAGE(WM_INITDIALOG, OnInitDialogEx)<BR>&nbsp;//}}AFX_MSG_MAP<BR>END_MESSAGE_MAP()</DIV><DIV>///////////////////////////////////////////////////////////////////////////////////////<BR></DIV><DIV></pre></td></tr></table>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 27 May 2008 12:51:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10799&amp;PID=35883&amp;title=cxtppropertysheet-and-oninitdialog#35883</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPPRopertySheet and OnInitDialog : Hello,  Sorry, now you can&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10799&amp;PID=35875&amp;title=cxtppropertysheet-and-oninitdialog#35875</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 10799<br /><strong>Posted:</strong> 27 May 2008 at 12:13pm<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>Sorry, now you can't change it, it was designed to work this way. We will check if it possible to enhance it. Thanks.</DIV>]]>
   </description>
   <pubDate>Tue, 27 May 2008 12:13:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10799&amp;PID=35875&amp;title=cxtppropertysheet-and-oninitdialog#35875</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPPRopertySheet and OnInitDialog : I have used CXTPPropertySheet/CXTPPropertyPage...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10799&amp;PID=35872&amp;title=cxtppropertysheet-and-oninitdialog#35872</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4202">gerrysweeney</a><br /><strong>Subject:</strong> 10799<br /><strong>Posted:</strong> 27 May 2008 at 11:56am<br /><br /><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">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: - <?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">When a CXTPPropertySheet is created (using DoModal()) each CXTPPropertyPage is created and its related OnInitDialog() is invoked.&nbsp; In&nbsp;the standard CPropertySheet/CPropertyPage the OnInitDialog method is only invoked if you switch to&nbsp;that tab which is of course far more efficient.&nbsp; 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.&nbsp; 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.&nbsp; 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, <o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">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?<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">&nbsp;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN">Gerry<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P>]]>
   </description>
   <pubDate>Tue, 27 May 2008 11:56:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10799&amp;PID=35872&amp;title=cxtppropertysheet-and-oninitdialog#35872</guid>
  </item> 
 </channel>
</rss>