<?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 : Creating multiple C&#070;ormView based Panes</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Docking Pane : Creating multiple C&#070;ormView based Panes]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 06:54:40 +0000</pubDate>
  <lastBuildDate>Wed, 27 Jul 2005 10:06:49 +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=2645</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[Creating multiple C&#070;ormView based Panes : I was stuck on this for a little...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2645&amp;PID=7882&amp;title=creating-multiple-cformview-based-panes#7882</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1280">turbowagon</a><br /><strong>Subject:</strong> 2645<br /><strong>Posted:</strong> 27 July 2005 at 10:06am<br /><br /><P>I was stuck on this for a little while, so I thought I'd share my solution.&nbsp; All of the examples using a CFormView to create a Dialog-based docking pane only made use of a single view class.&nbsp; I make use of the Docking Pane ID to handle each pane's creation:</P><P><table width="99%"><tr><td><pre class="BBcode"></P><P>int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<BR>{<BR>&nbsp;...</P><P>&nbsp;// Create docking panes.<BR>&nbsp;CXTPDockingPane* pPaneProperties = m_paneManager.CreatePane(<BR>&nbsp;&nbsp;PANEID_FORMVIEW, CRect(0, 0,210, 120), xtpPaneDockLeft);</P><P>&nbsp;CXTPDockingPane* pPaneSecond = m_paneManager.CreatePane(<BR>&nbsp;&nbsp;PANEID_SECONDFORM, CRect(0, 0, 210, 120), xtpPaneDockRight);</P><P>&nbsp;return 0;<BR>}</P><P></pre></td></tr></table></P><P>Then in the OnDockingPaneNotify message handler, you can use a switch statement to conditionally create the appropriate panes:</P><P><table width="99%"><tr><td><pre class="BBcode"></P><P>LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)<BR>{<BR>&nbsp;if (wParam == XTP_DPN_SHOWWINDOW)<BR>&nbsp;{<BR>&nbsp;&nbsp;CXTPDockingPane* pPane = (CXTPDockingPane*)lParam;</P><P>&nbsp;&nbsp;if (!pPane-&gt;IsValid())<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;switch(pPane-&gt;GetID())<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;case PANEID_FORMVIEW:</P><P>&nbsp;&nbsp;&nbsp;&nbsp;if (m_pFormFrame == NULL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pFormFrame = new CFrameWnd;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CCreateContext context;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pNewViewClass = RUNTIME_CLASS(CSimpleFormView);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pCurrentDoc = NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pFormFrame-&gt;Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this, NULL, 0, &amp;context);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pFormFrame-&gt;ModifyStyleEx (WS_EX_CLIENTEDGE, 0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pFormFrame-&gt;SendMessageTo Descendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</P><P>&nbsp;&nbsp;&nbsp;&nbsp;pPane-&gt;Attach(m_pFormFrame);<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;</P><P>&nbsp;&nbsp;&nbsp;case PANEID_SECONDFORM:</P><P>&nbsp;&nbsp;&nbsp;&nbsp;if (m_pSecondFrame == NULL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pSecondFrame = new CFrameWnd;</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CCreateContext context;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pNewViewClass = RUNTIME_CLASS(CSecondFormView);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pCurrentDoc = NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pSecondFrame-&gt;Create(NULL , NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this, NULL, 0, &amp;context);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pSecondFrame-&gt;ModifyStyle Ex(WS_EX_CLIENTEDGE, 0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_pSecondFrame-&gt;SendMessage ToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</P><P>&nbsp;&nbsp;&nbsp;&nbsp;pPane-&gt;Attach(m_pSecondFrame);<BR>&nbsp;&nbsp;&nbsp;&nbsp;break;</P><P>&nbsp;&nbsp;&nbsp;default:<BR>&nbsp;&nbsp;&nbsp;&nbsp;AfxMessageBox("Unknown pane ID");<BR>&nbsp;&nbsp;&nbsp;&nbsp;return FALSE;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;<BR>&nbsp;&nbsp;return TRUE;&nbsp;// handled<BR>&nbsp;}</P><P>&nbsp;return FALSE;<BR>}</P><P></pre></td></tr></table></P><span style="font-size:10px"><br /><br />Edited by turbowagon</span>]]>
   </description>
   <pubDate>Wed, 27 Jul 2005 10:06:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2645&amp;PID=7882&amp;title=creating-multiple-cformview-based-panes#7882</guid>
  </item> 
 </channel>
</rss>