<?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 : Pane&#039;s OnInitDialog not called</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Docking Pane : Pane&#039;s OnInitDialog not called]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 11:15:41 +0000</pubDate>
  <lastBuildDate>Tue, 14 Jun 2011 01:32:25 +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=18517</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[Pane&#039;s OnInitDialog not called : Try create it before you create...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64907&amp;title=panes-oninitdialog-not-called#64907</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 18517<br /><strong>Posted:</strong> 14 June 2011 at 1:32am<br /><br />Try create it before you create DockingPanes.]]>
   </description>
   <pubDate>Tue, 14 Jun 2011 01:32:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64907&amp;title=panes-oninitdialog-not-called#64907</guid>
  </item> 
  <item>
   <title><![CDATA[Pane&#039;s OnInitDialog not called : Hi Oleg,  That is exactly what...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64891&amp;title=panes-oninitdialog-not-called#64891</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 18517<br /><strong>Posted:</strong> 13 June 2011 at 6:09pm<br /><br />Hi Oleg,<DIV>&nbsp;</DIV><DIV>That is exactly what I already do, create panes at the end of the main frame's OnCreate(). The pane crashes&nbsp;because the pane dialog's window handle is 0 when <FONT size=2>OnDockingPaneNotify</FONT> is called. I found that the dialog template fails in<FONT size=2> CheckDialogTemplate(lpszTemplateName, FALSE)&nbsp;</FONT> inside&nbsp; CDialog::<FONT size=2>Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd)</FONT>.</DIV><DIV>&nbsp;</DIV><DIV>However, using identical pane code and creation code, everything works as expected when created on a CMDIChildWnd. I wonder if the mainframe is interfering with&nbsp;pane creation? My main frame is derived from two of your classes, like this:</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>class</FONT></FONT><FONT size=2> CMainFrame : </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>public</FONT></FONT><FONT size=2> CXTPMDIFrameWnd, CXTPOffice2007FrameHook</P><DIV></DIV><DIV>Are you sure they don't interfere with pane creation?</DIV><DIV>&nbsp;</DIV></FONT></DIV><DIV><FONT size=2><DIV>Michael</FONT></DIV></DIV>]]>
   </description>
   <pubDate>Mon, 13 Jun 2011 18:09:10 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64891&amp;title=panes-oninitdialog-not-called#64891</guid>
  </item> 
  <item>
   <title><![CDATA[Pane&#039;s OnInitDialog not called : If you need this dialog before...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64833&amp;title=panes-oninitdialog-not-called#64833</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 18517<br /><strong>Posted:</strong> 09 June 2011 at 7:42am<br /><br />If you need this dialog before user open pane you can create it directly in CMainFrame::OnCreate and only attach here.<div><br></div><div><br></div>]]>
   </description>
   <pubDate>Thu, 09 Jun 2011 07:42:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64833&amp;title=panes-oninitdialog-not-called#64833</guid>
  </item> 
  <item>
   <title><![CDATA[Pane&#039;s OnInitDialog not called : I forgot to mention a couple of...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64821&amp;title=panes-oninitdialog-not-called#64821</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 18517<br /><strong>Posted:</strong> 08 June 2011 at 7:50pm<br /><br />I forgot to mention a couple of things:<DIV>&nbsp;</DIV><DIV>Identical code works as expected when the docking pane is attached to an MDI child frame instead of the MainFrame window.</DIV><DIV>&nbsp;</DIV><DIV>Using ToolkitPro 13.4.2 DLL with x64 debug.</DIV><DIV>&nbsp;</DIV><DIV>Michael</DIV>]]>
   </description>
   <pubDate>Wed, 08 Jun 2011 19:50:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64821&amp;title=panes-oninitdialog-not-called#64821</guid>
  </item> 
  <item>
   <title><![CDATA[Pane&#039;s OnInitDialog not called : There&amp;#039;s Progress, butthere...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64819&amp;title=panes-oninitdialog-not-called#64819</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 18517<br /><strong>Posted:</strong> 08 June 2011 at 6:39pm<br /><br />There's Progress, but&nbsp;there still is a glitch.&nbsp; I was able to prevent the crash by inserting the following code into CMainFrame::OnDockingPaneNotify()<DIV>&nbsp;</DIV><DIV><FONT size=2><FONT face="Courier New, Courier, mono"><table width="99%"><tr><td><pre class="BBcode"></FONT></FONT></DIV><DIV><FONT size=2 face="Courier New">(m_pPaneTextEditor is a dialog)</FONT></DIV><DIV><FONT size=2><FONT face="Courier New, Courier, mono"><FONT color=#0000ff><FONT color=#0000ff>case</FONT></FONT></FONT><FONT face="Courier New, Courier, mono"> XTP_DPN_SHOWWINDOW:</FONT></FONT></DIV><DIV><FONT size=2 face="Courier New, Courier, mono">{</FONT></DIV><DIV><FONT size=2 face="Courier New">&nbsp; CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;</FONT></DIV><DIV><FONT size=2><FONT face="Courier New">&nbsp; </FONT><FONT color=#0000ff><FONT color=#0000ff face="Courier New, Courier, mono">if</FONT></FONT><FONT face="Courier New, Courier, mono"> ( pPane )</FONT></FONT></DIV><DIV><FONT size=2 face="Courier New">&nbsp; {</FONT></DIV><DIV><FONT size=2><FONT face="Courier New">&nbsp; </FONT><FONT color=#0000ff><FONT color=#0000ff face="Courier New, Courier, mono">switch</FONT></FONT><FONT face="Courier New, Courier, mono"> ( pPane-&gt;GetID() )</FONT></FONT></DIV><DIV><FONT size=2 face="Courier New">&nbsp; {</FONT></DIV><DIV><FONT size=2><FONT face="Courier New">&nbsp;&nbsp;&nbsp; </FONT><FONT color=#0000ff><FONT color=#0000ff face="Courier New, Courier, mono">case</FONT></FONT><FONT face="Courier New, Courier, mono"> IDR_PANE_TEXT_EDITOR:</FONT></FONT></DIV><DIV><FONT size=2><FONT color=#0000ff><FONT color=#0000ff face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</FONT></FONT><FONT face="Courier New, Courier, mono"> ( ! pPane-&gt;IsValid() )</FONT></FONT></DIV><DIV><FONT size=2><FONT face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></FONT></DIV><DIV><FONT size=2><FONT face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT color=#993300><FONT face="Courier New, Courier, mono">if</FONT><FONT face="Courier New, Courier, mono"> ( ! ::IsWindow( m_pPaneTextEditor-&gt;GetSafeHwnd() ) )&nbsp;&nbsp;&nbsp; // added</FONT></FONT></FONT><FONT size=2><FONT face="Courier New, Courier, mono"></FONT></FONT></DIV><DIV><FONT size=2><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pPaneTextEditor-&gt;Create(IDD_PANE_TEXT_EDITOR, </FONT><FONT color=#0000ff><FONT color=#0000ff face="Courier New, Courier, mono">this</FONT></FONT><FONT face="Courier New, Courier, mono">);</FONT></FONT></DIV><DIV><FONT size=2 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pPane-&gt;Attach(m_pPaneTextEditor);</FONT></DIV><DIV><FONT size=2 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV><DIV><FONT size=2><FONT face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT color=#0000ff><FONT color=#0000ff face="Courier New, Courier, mono">break</FONT></FONT><FONT face="Courier New, Courier, mono">;</FONT></FONT></DIV><DIV><FONT size=2 face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; }</FONT></DIV><DIV><FONT size=2><FONT face="Courier New">&nbsp;&nbsp;&nbsp; </FONT><FONT color=#0000ff><FONT color=#0000ff face="Courier New, Courier, mono">return</FONT></FONT><FONT face="Courier New, Courier, mono"> TRUE;</FONT></FONT></DIV><DIV><FONT size=2><FONT face="Courier New, Courier, mono"></pre></td></tr></table></FONT></FONT></DIV><DIV><FONT size=2 face="Courier New"></FONT>&nbsp;</DIV><DIV><DIV><FONT size=2></FONT></DIV><DIV><FONT size=2>After this change,&nbsp;I can&nbsp;open the pane without a crash. Remember that the app opens with this pane&nbsp;closed&nbsp;on the right main frame border. Text is written into its CEdit control before the pane is ever opened. After I open it the first time,&nbsp;it does not auto-hide.</FONT><FONT size=2>&nbsp;When I move the mouse off the pane, it does not snap shut. I fact, there's no way I can make it hide unless I p</FONT><FONT size=2>in and then unpin it.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>On the other hand,&nbsp;if I open</FONT><FONT size=2> a document before opening the pane&nbsp;the first time, then the pane auto-hides as expected.&nbsp;But if I close the document before opening the pane the first time, the pane does not&nbsp;auto-hide. In other words, a document must be open when I open the pane&nbsp;the first time in order to have it auto-hide when it closes the first time.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>After the pane closes once, it auto-hides correctly in the future.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Any thoughts?</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Michael</FONT></DIV></DIV>]]>
   </description>
   <pubDate>Wed, 08 Jun 2011 18:39:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64819&amp;title=panes-oninitdialog-not-called#64819</guid>
  </item> 
  <item>
   <title><![CDATA[Pane&#039;s OnInitDialog not called : I&amp;#039;ll start by saying I&amp;#039;ve...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64818&amp;title=panes-oninitdialog-not-called#64818</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2349">MichaelN</a><br /><strong>Subject:</strong> 18517<br /><strong>Posted:</strong> 08 June 2011 at 1:25pm<br /><br /><DIV>I'll start by saying I've been using panes for some time for a lot of other things and they work fine. But&nbsp;I can't make this one work and I can't figure out the initialization sequence for it.</DIV><DIV>&nbsp;</DIV><DIV>The pane uses a dialog that has a CEdit control that the app sends text&nbsp;strings to. The app starts with this pane docked to the side of the mainframe. Strings may be sent with or without the pane open, and&nbsp;the app&nbsp;sends some strings to it before the pane is opened the first time.&nbsp; Then, when I open the pane the first time, the app crashes. I can see that the dialog's OnInitDialog() was not called and the DDX was never called to attach a window to the edit control.</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2>What I did to initialize: At the end of the mainframe's OnCreate(), the pane's dialog object&nbsp;was created and pane-&gt;Create(IDD,this) was called. </FONT>The first message fired inside<FONT size=2>&nbsp;CMainFrame::OnDockingPaneNotify()</FONT>&nbsp;is <FONT size=2>xtpPaneActionExpanding. Inside that case,&nbsp; pane-&gt;IsValid() returns&nbsp;FALSE.&nbsp;Therefore, I call pane-&gt;Attach(m_pPaneTextEditor) and it crashes. As I said, the dialog's OnInitDialog() was never called and the window handles are 0.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV>Where/how can I make this work in the pane opening sequence?</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>&nbsp;</DIV><DIV>Michael</DIV>]]>
   </description>
   <pubDate>Wed, 08 Jun 2011 13:25:01 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18517&amp;PID=64818&amp;title=panes-oninitdialog-not-called#64818</guid>
  </item> 
 </channel>
</rss>