<?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 : 10.4.2 print preview assert/crash</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Calendar : 10.4.2 print preview assert/crash]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 30 May 2026 12:43:33 +0000</pubDate>
  <lastBuildDate>Sat, 10 Feb 2007 19:42:50 +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=6364</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[10.4.2 print preview assert/crash : Solved. It had nothing to do with...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6364&amp;PID=20264&amp;title=10-4-2-print-preview-assert-crash#20264</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2657">Algae</a><br /><strong>Subject:</strong> 6364<br /><strong>Posted:</strong> 10 February 2007 at 7:42pm<br /><br />Solved. It had nothing to do with the Codejock code.<br><br>Sserge's hint regarding "And how can you exit app without closing PrintPreview first?" tipped me off to trace there. I was assuming PrintPreview would close itself! This is not always the case.<br><br>I was running both the sample and my app through an MDI framework. In the MDI framework the order of dispose is ordered from 1st to last view on the same doc. The Calendar view was being disposed before the Preview view and the Preview view close could never be reached.<br><br>In order to solve, set a BOOL flag in the doc that the Preview view is associated with. In the "OnCloseDocument()" in the doc file, catch the flag and send a close preview message to all the views associated with the doc.<br><br>void CCalendarDoc::OnCloseDocument()<br>{<br>&nbsp;if ( m_bIsPreview )<br>&nbsp;{<br>&nbsp;&nbsp;&nbsp; m_bIsPreview = FALSE;<br>&nbsp;&nbsp;&nbsp; POSITION pos = GetFirstViewPosition();<br>&nbsp;&nbsp;&nbsp; while (pos != NULL)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CView* pView = GetNextView(pos);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pView-&gt;SendMessage( WM_COMMAND, AFX_ID_PREVIEW_CLOSE, 0);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return;<br>&nbsp;}<br>&nbsp;&nbsp;&nbsp; // rest of close document stuff here<br>}<br><br>In the view where you have the print preview, OnFilePrintPreview(),&nbsp; set the BOOL flag so the document knows the status if it goes to close:<br><br>void CCalendarView::OnFilePrintPreview()<br>{<br>&nbsp;&nbsp;&nbsp; CCalendarDoc* pDoc = (CCalendarDoc*)GetDocument() ;<br>&nbsp;&nbsp;&nbsp; pDoc-&gt;m_bIsPreview = TRUE ;<br><br>&nbsp;&nbsp;&nbsp; // rest of the printpreview stuff goes here<br>}<br><br>Now you should be able to close the document by any normal means and it will pick up and send the signal to close printpreview.<br><br>Thanks for the hint Sserge <img src="http://forum.codejock.com/smileys/smiley1.gif" border="0" align="absmiddle"><br>]]>
   </description>
   <pubDate>Sat, 10 Feb 2007 19:42:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6364&amp;PID=20264&amp;title=10-4-2-print-preview-assert-crash#20264</guid>
  </item> 
  <item>
   <title><![CDATA[10.4.2 print preview assert/crash : Normally m_pUpdateContect (yes,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6364&amp;PID=20255&amp;title=10-4-2-print-preview-assert-crash#20255</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 6364<br /><strong>Posted:</strong> 09 February 2007 at 5:12pm<br /><br />Normally m_pUpdateContect (yes, should be conte<b>x</b>t) is destroyed in CXTPCalendarControlView::OnEndPrinting.<br>&nbsp;<br>This ASSERT means that PrintPreview was not correclty finished.<br>&nbsp;<br>And how can you exit app without closing PrintPreview first?<br><br>What is your VC version 6.0, 7.0, 7.1,&nbsp; 8.0 ?<br>&nbsp;<br>I tried on Calendar Demo sample - both Alt+F4 and "x" button close PrintPreview on first click, on the second one app is closed.<br><br>--<br>WBR,<br>Serge <br>]]>
   </description>
   <pubDate>Fri, 09 Feb 2007 17:12:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6364&amp;PID=20255&amp;title=10-4-2-print-preview-assert-crash#20255</guid>
  </item> 
  <item>
   <title><![CDATA[10.4.2 print preview assert/crash : Hello, I noticed the following...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6364&amp;PID=20254&amp;title=10-4-2-print-preview-assert-crash#20254</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2657">Algae</a><br /><strong>Subject:</strong> 6364<br /><strong>Posted:</strong> 09 February 2007 at 3:18pm<br /><br /><br>Hello, <br><br>I noticed the following bug while running a version of my app using 10.4.2.<br><br>When you close the application with a calendar view print preview active it will assert (crash in release) in the destructor at the noted line: <br><br>CXTPCalendarControlView::~CXTPCalendarControlView()<br>{<br>&nbsp;&nbsp; &nbsp;if (m_bReleaseCalendarWhenDestroy)<br>&nbsp;&nbsp; &nbsp;{<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CMDTARGET_RELEASE(m_pCalendar);<br>&nbsp;&nbsp; &nbsp;}<br><br>&nbsp;&nbsp; &nbsp;ASSERT(m_pUpdateContect == NULL); // &lt;&lt;&lt;&lt; will assert here<br>&nbsp;&nbsp; &nbsp;SAFE_DELETE(m_pUpdateContect);<br><br>&nbsp;&nbsp; &nbsp;CMDTARGET_RELEASE(m_pPrintOptions);<br>}<br><br>Apparently the contect (context?) isn't freed up ahead of time. This bug is also present in the calendardemo sample.<br><br><br>]]>
   </description>
   <pubDate>Fri, 09 Feb 2007 15:18:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6364&amp;PID=20254&amp;title=10-4-2-print-preview-assert-crash#20254</guid>
  </item> 
 </channel>
</rss>