<?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 : ReportSampleView as an MDI window</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : ReportSampleView as an MDI window]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 20 Apr 2026 22:59:04 +0000</pubDate>
  <lastBuildDate>Thu, 03 Mar 2005 05:20:42 +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=1860</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[ReportSampleView as an MDI window : Hi Sergey, Yep, that works fine,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5519&amp;title=reportsampleview-as-an-mdi-window#5519</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=771">cdyckes</a><br /><strong>Subject:</strong> 1860<br /><strong>Posted:</strong> 03 March 2005 at 5:20am<br /><br /><P>Hi Sergey,</P><P>Yep, that works fine, just got to decide what field state gets saved now.</P><P>Thanks</P><P>Colin</P>]]>
   </description>
   <pubDate>Thu, 03 Mar 2005 05:20:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5519&amp;title=reportsampleview-as-an-mdi-window#5519</guid>
  </item> 
  <item>
   <title><![CDATA[ReportSampleView as an MDI window : Hi Colin,    Yep, my solution...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5492&amp;title=reportsampleview-as-an-mdi-window#5492</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 1860<br /><strong>Posted:</strong> 02 March 2005 at 6:25am<br /><br />Hi Colin,<br /><br />  Yep, my solution missed one more thing -- when the last view is closing and we are deleting Field Chooser object inside the View destructor, we should also Unsubclass subclassed window :) So, this piece of code in CReportSampleView::~CReportSampleView() will look in the following way:<br />.....<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(ms_pWndSubList) {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ms_pWndSubList-&gt;UnsubclassW indow();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete  ms_pWndSubList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ms_pWndSubList  = NULL;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />......<br /><br />And the same for Filter Edit window.<br /><br />--<br />Best regards,<br />Sergey]]>
   </description>
   <pubDate>Wed, 02 Mar 2005 06:25:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5492&amp;title=reportsampleview-as-an-mdi-window#5492</guid>
  </item> 
  <item>
   <title><![CDATA[ReportSampleView as an MDI window : Sergey, I&amp;#039;d tried :- ms...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5467&amp;title=reportsampleview-as-an-mdi-window#5467</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=771">cdyckes</a><br /><strong>Subject:</strong> 1860<br /><strong>Posted:</strong> 01 March 2005 at 11:36am<br /><br /><P>Sergey,</P><P>I'd tried :-</P><P>&nbsp;&nbsp;&nbsp;ms_pWndSubList-&gt;UpdateList(); <BR> &nbsp;&nbsp;&nbsp;ms_pWndSubList-&gt;SetReportCtrl(&amp;m_wn dReport); <BR></P><P>which solved the problem of switching between views but not that of closing all views and opening a new one.</P><P>I just tried your suggestion but that causes an assertion failure when opening a new view having closed all the open views:-</P><P>_AFXWIN_INLINE void CListBox::ResetContent()<BR>&nbsp;{ ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_RESETCONTENT, 0, 0); }<BR></P><P>m_hWnd is 0</P><P>Nearly there I think.</P><P>Thanks</P><P>Colin</P>]]>
   </description>
   <pubDate>Tue, 01 Mar 2005 11:36:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5467&amp;title=reportsampleview-as-an-mdi-window#5467</guid>
  </item> 
  <item>
   <title><![CDATA[ReportSampleView as an MDI window : Hi Colin,    Try resetting Field...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5466&amp;title=reportsampleview-as-an-mdi-window#5466</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 1860<br /><strong>Posted:</strong> 01 March 2005 at 11:18am<br /><br />Hi Colin,<br /><br />  Try resetting Field Chooser contents firstly in OnActivateView:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(bActivate) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (ms_pWndSubList) <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ms_pWndSubList-&gt;ResetConten t();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ms_pWndSubList-&gt;SetReportCt rl(&m_wndReport);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />......<br /><br />  That should help.<br /><br />--<br />Best regards,<br />Sergey]]>
   </description>
   <pubDate>Tue, 01 Mar 2005 11:18:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5466&amp;title=reportsampleview-as-an-mdi-window#5466</guid>
  </item> 
  <item>
   <title><![CDATA[ReportSampleView as an MDI window : Sergey, Brilliant!! That does...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5465&amp;title=reportsampleview-as-an-mdi-window#5465</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=771">cdyckes</a><br /><strong>Subject:</strong> 1860<br /><strong>Posted:</strong> 01 March 2005 at 10:32am<br /><br /><P>Sergey,</P><P>Brilliant!!&nbsp;&nbsp; That does what I need and has saved hours of fumbling around in the dark-space that&nbsp;passes for&nbsp;Xtreme Toolkit documentation <IMG src="http://forum.codejock.com/smileys/smiley1.gif" border="0">.&nbsp;&nbsp;&nbsp;&nbsp; Thank You!</P><P>One minor problem I've noticed is that this solution leaves the Field Chooser fields at the values last set in any active ReportView, but, more importantly, the Field Chooser loses all of its field entries if all Report views are closed and then a new one opened.</P><P>I can probably figure that one out myself, but have you by any chance solved this problem as well?&nbsp;&nbsp;&nbsp;&nbsp; (Reached brain saturation point&nbsp;in a mapi in c++ implementation <IMG src="http://forum.codejock.com/smileys/smiley19.gif" border="0">&nbsp;)</P><P>Thanks again</P><P>Colin</P>]]>
   </description>
   <pubDate>Tue, 01 Mar 2005 10:32:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5465&amp;title=reportsampleview-as-an-mdi-window#5465</guid>
  </item> 
  <item>
   <title><![CDATA[ReportSampleView as an MDI window : Hello Colin,    The main idea...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5458&amp;title=reportsampleview-as-an-mdi-window#5458</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 1860<br /><strong>Posted:</strong> 01 March 2005 at 2:22am<br /><br />Hello Colin,<br /><br />  The main idea could be to make Field Chooser and Filter Edit dialogs as singletons for the application. It could be done via using static pointers in your view. You'd also have to change dialogs initialization code inside OnInitialUpdate method.<br /><br />  Also you have to catch OnActivateView event -- this would allow you to force both dialogs to work with the currently active view. <br /><br />  Take a look at the sample code below:<br /><br />// h-File<br /> //////////////////////////////////////////////////////////// //////////////<br />class CReportSampleView : public CView <br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />protected: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;static CXTPReportSubListControl* ms_pWndSubList;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;static CXTPReportFilterEditControl* ms_pWndFilterEdit;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;static int s_nViewsCount;<br />&nbsp;&nbsp;&nbsp;&nbsp;// ... other declarations<br />};<br /><br />// cpp-File<br />/// //////////////////////////////////////////////////////////// //////////////<br />CXTPReportSubListControl* CReportSampleView::ms_pWndSubList = NULL;<br />CXTPReportFilterEditControl* CReportSampleView::ms_pWndFilterEdit = NULL;<br />int CReportSampleView::s_nViewsCount = 0;&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />// CReportSampleView construction/destruction<br />CReportSampleView::CReportSampleView()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;s_nViewsCount++;<br />}<br /><br />CReportSampleView::~CReportSampleView()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;s_nViewsCount--;<br />&nbsp;&nbsp;&nbsp;&nbsp;ASSERT(s_nViewsCount &gt;=0);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(s_nViewsCount == 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(ms_pWndSubList) {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  ms_pWndSubList-&gt;UnsubclassWindow(); <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  delete ms_pWndSubList;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  ms_pWndSubList = NULL;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(ms_pWndFilterEdit) {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  ms_pWndFilterEdit-&gt;UnsubclassWindow(); <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  delete ms_pWndFilterEdit;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  ms_pWndFilterEdit  = NULL;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br />void CReportSampleView::OnInitialUpdate() <br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CView::OnInitialUpdate();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CMainFrame* pWnd = (CMainFrame*)AfxGetMainWnd();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Init CXTPReportSubListControl<br />&nbsp;&nbsp;&nbsp;&nbsp;if (!ms_pWndSubList) <br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ms_pWndSubList = new CXTPReportSubListControl();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!ms_pWndSubList)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;if (!::IsWindow(ms_pWndSubList-&gt;GetSafeHwnd()))<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;   ms_pWndSubList-&gt;SubclassDlgItem(IDC_COLUMNLIST, &pWnd-&gt;m_wndFieldChooser);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_wndReport.GetColumns()-&gt;G etReportHeader()-&gt;SetSubListCtrl(ms_pWndSubList);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;ms_pWndSubList-&gt;SetReportCtrl(&m_wndReport); <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Init CXTPReportFilterEditControl in the same way as above with CXTPReportSubListControl<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// ...<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />}<br /><br />void CReportSampleView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(bActivate) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (ms_pWndSubList) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;   ms_pWndSubList-&gt;ResetContent();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;   ms_pWndSubList-&gt;SetReportCtrl(&m_wndReport);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (ms_pWndFilterEdit) <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;   ms_pWndFilterEdit-&gt;SetReportCtrl(&m_wndReport);<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;CView::OnActivateView(bActivate, pActivateView, pDeactiveView);<br />}<br /> <br /><br />--<br />Best regards,<br />Sergey<span style="font-size:10px"><br /><br />Edited by sserge</span>]]>
   </description>
   <pubDate>Tue, 01 Mar 2005 02:22:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5458&amp;title=reportsampleview-as-an-mdi-window#5458</guid>
  </item> 
  <item>
   <title><![CDATA[ReportSampleView as an MDI window : I&amp;#039;ve got a project where...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5398&amp;title=reportsampleview-as-an-mdi-window#5398</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=771">cdyckes</a><br /><strong>Subject:</strong> 1860<br /><strong>Posted:</strong> 25 February 2005 at 10:31am<br /><br /><P>I've got a project where I've used the ReportSampleView .cpp and .h as the basis of my view class. My project is an MDI rather than SDI and I've got two questions:-</P><P>1) Opening a second view causes a break in the CReportSampleView::OnInitialUpdate() function when the code attempts to subclass IDC_COLUMNLIST and IDC_FILTEREDIT. </P><P>I know why this fails, but does anyone have any sample code that shows how this should be done?</P><P>2) The second question has been addressed on this group, but solved by the original poster without posting the answer:- <IMG src="http://forum.codejock.com/smileys/smiley19.gif" border="0"></P><P>I need the Field Chooser and Filter Edit dialogs to work with the current active view as the use switches between views. Again any sample code would be much appreciated.</P><P>Same problem exists with both 9510 and 9600 releases.</P><P>Thanks</P><P>Colin</P>]]>
   </description>
   <pubDate>Fri, 25 Feb 2005 10:31:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1860&amp;PID=5398&amp;title=reportsampleview-as-an-mdi-window#5398</guid>
  </item> 
 </channel>
</rss>