<?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 : OnSetPreviewMode bug in VC2005</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : OnSetPreviewMode bug in VC2005]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 16 Jun 2026 04:13:01 +0000</pubDate>
  <lastBuildDate>Tue, 27 Jun 2006 09:07:54 +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=4498</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[OnSetPreviewMode bug in VC2005 : I&amp;#039;ve just located apossibleproblem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4498&amp;PID=13861&amp;title=onsetpreviewmode-bug-in-vc2005#13861</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=306">JonN</a><br /><strong>Subject:</strong> 4498<br /><strong>Posted:</strong> 27 June 2006 at 9:07am<br /><br /><P>I've just located a&nbsp;possible&nbsp;problem in the print preview sample for VC2005. Updating one of my programs from VC6 to VC2005, I discovered that the behaviour of OnSetPreviewMode has been altered slightly by Microsoft.&nbsp; </P><DIV>The print preview MDI code sample (and my project) no longer hide command bars, docking panes or tab bars when print preview is selected.&nbsp; This seems to be due to the fact that OnSetPreviewMode in CMainFrame is no longer called by the framework.&nbsp; Searching through the code reveals that instead of the framework calling AfxGetMainWnd() to locate the parent frame, it now calls GetParentFrame() which of course finds the current active CMDIChildWnd.</DIV><DIV>&nbsp;</DIV><DIV>As a workaround, I've added the following function to my CChildFrame class,</DIV><FONT size=2><FONT color=#0000ff size=2><P>void</FONT><FONT size=2> CChildFrame::OnSetPreviewMode(BOOL bPreview, CPrintPreviewState* pState)</P><DIV>{</DIV><P>GetParentFrame()-&gt;OnSetPreviewMode(bPreview, pState);</P><DIV>CMDIChildWnd::OnSetPreviewMode(bPreview, pState);</DIV><P>}</P><DIV></DIV><P>This ensures that the parent CMainFrame class gets called.&nbsp; In addition the call to CMDIFrameWnd::OnSetPreviewMode(...) in CMainFrame::OnSetPreviewMode(...) should be removed, otherwise the program asserts.</P><DIV></DIV>I'm sure there is a more elgant solution to this problem, but for now this works. <IMG height=17 alt=Wink src="http://forum.codejock.com/smileys/smiley2.gif" width=17 align=absMiddle border="0"></FONT></FONT>]]>
   </description>
   <pubDate>Tue, 27 Jun 2006 09:07:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4498&amp;PID=13861&amp;title=onsetpreviewmode-bug-in-vc2005#13861</guid>
  </item> 
 </channel>
</rss>