<?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 : Issue due to SetColumnWidthWYSIWYG</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Issue due to SetColumnWidthWYSIWYG]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 09:45:38 +0000</pubDate>
  <lastBuildDate>Mon, 19 Mar 2012 04:12:46 +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=19582</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[Issue due to SetColumnWidthWYSIWYG : Hi We are using &amp;#034;Xtreme ToolkitPro...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=19582&amp;PID=67821&amp;title=issue-due-to-setcolumnwidthwysiwyg#67821</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2903">KumarCJ</a><br /><strong>Subject:</strong> 19582<br /><strong>Posted:</strong> 19 March 2012 at 4:12am<br /><br />Hi <br><br>We are using "Xtreme ToolkitPro v15.1.3". We are using customized print dialog and related function. The flow of function is<br><br><b>BOOL CGridViewCJ::OnPreparePrinting(CPrintInfo* pInfo)</b><br>{<br>...<br>// Delete the CPrintDialog object created in the CPrintInfo<br><br>...<br>// Construct and substitute with customized print dialog.<br><br>....<br>// Set the page range<br><br>...<br>// Change the PRINTDLG struct so that the custom print dialog<br><br>...<br>// Set the flags of the PRINTDLG structure otherwise the changes will have no effect.<br><br>....<br>and other initializations such as paper, title<br><br>// Call another function <br><b>ABC();</b><br><br>}// End of OnPreparePrinting()<br><br><br><b>void CCMCGridViewCJ::ABC()</b><br>{<br>....<br>&nbsp;&nbsp; /* get the page layout record */<br>&nbsp;&nbsp; if (!GetLayoutRecord(nLayoutId, &amp;Layout))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br><br>&nbsp;&nbsp; int nTop, nLeft, nBottom, nRight;<br>&nbsp;&nbsp; nTop&nbsp;&nbsp;&nbsp;&nbsp; = Layout.nTopMargin; // unit is in 1000th of an inch<br>&nbsp;&nbsp; nLeft&nbsp;&nbsp;&nbsp; = Layout.nLeftMargin;<br>&nbsp;&nbsp; nBottom&nbsp; = Layout.nBottomMargin;<br>&nbsp;&nbsp; nRight&nbsp;&nbsp; = Layout.nRightMargin;<br><br>&nbsp;&nbsp;&nbsp; //SK:9312<br>&nbsp;&nbsp; GetPaintManager()-&gt;SetColumnWidthWYSIWYG(TRUE);<br>&nbsp;&nbsp; m_pPrintOptions-&gt;GetPageHeader()-&gt;m_lfFont = *(GetLogFont(TITLEFONTINDEX));<br>&nbsp;&nbsp; // assume title is at center(row1,col2).<br>&nbsp;&nbsp; CString strHeaderFormat;<br><br>&nbsp;&nbsp; // date setup<br>&nbsp;&nbsp; if (Layout.bTitleDate)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strHeaderFormat = "&amp;d";<br>&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strHeaderFormat = g_null;<br><br>&nbsp;&nbsp;&nbsp; // assume title is at center(row1,col2).<br>&nbsp;&nbsp; if (Layout.bTitle)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strHeaderFormat = strHeaderFormat + "&amp;b" + lpMPrintOpt-&gt;szDetailString;<br>&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strHeaderFormat = g_null;<br><br>&nbsp;&nbsp; if(!strHeaderFormat.IsEmpty())<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pPrintOptions-&gt;GetPageHeader()-&gt;m_strFormatString = _T(strHeaderFormat);&nbsp; <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // set page count option<br>&nbsp;&nbsp; CString strPageCode;<br>&nbsp;&nbsp; strPageCode.LoadString(IDS_RG_PRINT_PAGE);<br>&nbsp;&nbsp; m_pPrintOptions-&gt;GetPageFooter()-&gt;m_strFormatString = _T(strPageCode);<br>&nbsp;&nbsp; CRect rect;<br>&nbsp;&nbsp; if(m_pPrintOptions-&gt;IsMarginsMeasureInches())<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.top = nTop;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.bottom = nBottom;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.left = nLeft;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.right = nRight;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pPrintOptions-&gt;m_rcMargins = rect;<br>&nbsp;&nbsp; }<br>&nbsp;&nbsp; else<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.top = nTop/1000;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.bottom = nBottom/1000;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.left = nLeft/1000;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rect.right = nRight/1000;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_pPrintOptions-&gt;m_rcMargins =&nbsp; rect;<br>&nbsp;&nbsp; }<br><br>}<br><br><br>The above functions flow works OK and display the Print dialog on WIN XP, But the when we tried to build the application (32 bits) on WIN 7 (64 bits) and run the exe in debug/release mode, then after displaying the Print Dialog application get crashed on WIN 7 (64 bits).<br><br>&#091;Note: above 2 function is for 32bit application &#093;<br><br>call to "GetPaintManager()-&gt;SetColumnWidthWYSIWYG(TRUE);" leads to "CXTPReportPaintManager::GetPrintPageWidth()" and then it fails.<br><br>I observe that "GetPrinterDeviceDefaults(...)" get called from our own function flow and also due to "<b>GetPaintManager()-&gt;SetColumnWidthWYSIWYG(TRUE);</b>" in ABC(..) function.<br><br><b>Please see the attached call stack "Print Diloag Crash-Call Stack.zip"</b><br><a href="uploads/2903/Print_Diloag_Crash-Call_Stack.zip" target="_blank">uploads/2903/Print_Diloag_Crash-Call_Stack.zip</a><br><br>Please help me out.<br><br>Thanks,<br>Saket Kumar<br>]]>
   </description>
   <pubDate>Mon, 19 Mar 2012 04:12:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=19582&amp;PID=67821&amp;title=issue-due-to-setcolumnwidthwysiwyg#67821</guid>
  </item> 
 </channel>
</rss>