<?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 : Crash in CXTPImageManager::SplitBitmap</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Crash in CXTPImageManager::SplitBitmap]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 22 Apr 2026 18:20:48 +0000</pubDate>
  <lastBuildDate>Tue, 19 Aug 2008 15:24:00 +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=11838</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[Crash in CXTPImageManager::SplitBitmap : That&amp;#039;s exactly what I was...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40107&amp;title=crash-in-cxtpimagemanagersplitbitmap#40107</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2302">PierreL</a><br /><strong>Subject:</strong> 11838<br /><strong>Posted:</strong> 19 August 2008 at 3:24pm<br /><br /><img src="http://forum.codejock.com/smileys/smiley20.gif" border="0" align="absmiddle"><br><br>That's exactly what I was missing. <br>Thank you Oleg!<br><br>I appreciate it,<br>Peter<br>]]>
   </description>
   <pubDate>Tue, 19 Aug 2008 15:24:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40107&amp;title=crash-in-cxtpimagemanagersplitbitmap#40107</guid>
  </item> 
  <item>
   <title><![CDATA[Crash in CXTPImageManager::SplitBitmap : Try to replace m_bmpCache.CreateCompatibleBitmap(pDC,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40056&amp;title=crash-in-cxtpimagemanagersplitbitmap#40056</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11838<br /><strong>Posted:</strong> 19 August 2008 at 1:35am<br /><br />Try to replace<DIV><FONT face="Courier New" color=#000099 size=2>&nbsp;m_bmpCache.CreateCompatibleBitmap(pDC, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in_popupCtrlSize.cx, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in_popupCtrlSize.cy);</FONT></DIV><DIV><FONT face="Courier New" color=#000099 size=2></FONT>&nbsp;</DIV><DIV><FONT face="Courier New" color=#000099 size=2>to </FONT></DIV><DIV><FONT face="Courier New" color=#000099 size=2>m_bmpCache.Attach(</FONT>XTPImageManager::Create32BPPDIBSection(<FONT face="Courier New" color=#000099 size=2> pDC, in_popupCtrlSize.cx, in_popupCtrlSize.cy</FONT>);<BR></DIV>]]>
   </description>
   <pubDate>Tue, 19 Aug 2008 01:35:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40056&amp;title=crash-in-cxtpimagemanagersplitbitmap#40056</guid>
  </item> 
  <item>
   <title><![CDATA[Crash in CXTPImageManager::SplitBitmap : But I need them to be alpha!?...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40043&amp;title=crash-in-cxtpimagemanagersplitbitmap#40043</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2302">PierreL</a><br /><strong>Subject:</strong> 11838<br /><strong>Posted:</strong> 18 August 2008 at 4:15pm<br /><br />But I need them to be alpha!? If I set <font color="#000099" size="2" face="Courier New">m_isAlpha to </font>FALSE then my popup ctrl is black, I don't see my bitmap background image.<br><br>This popup control's bitmap needs to be semi-transparent.<br>]]>
   </description>
   <pubDate>Mon, 18 Aug 2008 16:15:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40043&amp;title=crash-in-cxtpimagemanagersplitbitmap#40043</guid>
  </item> 
  <item>
   <title><![CDATA[Crash in CXTPImageManager::SplitBitmap : After you change them, they not...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40040&amp;title=crash-in-cxtpimagemanagersplitbitmap#40040</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11838<br /><strong>Posted:</strong> 18 August 2008 at 3:19pm<br /><br />After you change them, they not Alpha bitmaps. don't set <FONT face="Courier New" color=#000099 size=2>m_isAlpha to TRUE.</FONT>]]>
   </description>
   <pubDate>Mon, 18 Aug 2008 15:19:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40040&amp;title=crash-in-cxtpimagemanagersplitbitmap#40040</guid>
  </item> 
  <item>
   <title><![CDATA[Crash in CXTPImageManager::SplitBitmap : Thanks for the reply Oleg,I would...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40024&amp;title=crash-in-cxtpimagemanagersplitbitmap#40024</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2302">PierreL</a><br /><strong>Subject:</strong> 11838<br /><strong>Posted:</strong> 18 August 2008 at 11:08am<br /><br /><font face="Arial, Helvetica, sans-serif">Thanks for the reply Oleg,<br><br>I would do that if I was loading my bitmap from resources. What I'm doing is constructing a bitmap at runtime.<br><br>My goal is to construct a bitmap for a CXTPopupControl-derived class so it has the same width as my "host" window (on resize). To do so I use three HBITMAP parts that I've pre-loaded. I construct this bitmap in a memDC and use BitBlt. I do the left part, then iterate 'x' times for the middle part then end with the right part. I'm possibly doing something wrong in my construction of this bitmap? Here's a sample of what I'm doing (I removed the sanity checks and error handling). Again, this works in a 32 bits display setting.</font><br><br><br><font color="#000099" size="2" face="Courier New, Courier, mono">void MyPopupCtrl::BuildBitmap(CSize in_popupCtrlSize)<br>{ &nbsp;<br>&nbsp;&nbsp;&nbsp; CDC* pDC = GetDC();<br><br>&nbsp;&nbsp;&nbsp; CDC memDC;<br>&nbsp;&nbsp;&nbsp; memDC.CreateCompatibleDC(pDC);<br><br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// re-create the bitmap cache.</font><br>&nbsp;&nbsp;&nbsp; m_bmpCache.DeleteObject();<br>&nbsp;&nbsp;&nbsp; m_bmpCache.CreateCompatibleBitmap(pDC, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in_popupCtrlSize.cx, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in_popupCtrlSize.cy);<br><br>&nbsp;&nbsp;&nbsp; CBitmap* pOldBitmap = memDC.SelectObject(&amp;m_bmpCache);<br><br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Select the leftmost part of the bitmap into the source DC</font><br>&nbsp;&nbsp;&nbsp; CXTPCompatibleDC srcDCLeft(pDC, m_hbmpLeft);<br>&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; CXTPEmptyRect rcDest, rcSrc;<br>&nbsp;&nbsp;&nbsp; rcDest.SetRect(0, 0, m_bmpLeftSize.cx, m_bmpLeftSize.cy);<br>&nbsp;&nbsp;&nbsp; rcSrc.SetRect(0, 0, m_bmpLeftSize.cx, m_bmpLeftSize.cy);<br><br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Write to the memDC</font><br>&nbsp;&nbsp;&nbsp; BitBlt(memDC,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcDest.left,rcDest.top, rcDest.Width(), rcDest.Height(),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srcDCLeft,0,0,SRCCOPY);<br><br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Select the middle part into a source DC</font><br>&nbsp;&nbsp;&nbsp; CXTPCompatibleDC srcDCMid(pDC, m_hbmpMid); <br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Reset the destination rect by moving the x-coordinate.</font><br>&nbsp;&nbsp;&nbsp; rcDest.left += m_bmpLeftSize.cx;<br>&nbsp;&nbsp;&nbsp; rcDest.right = rcDest.left + m_bmpMidSize.cx;<br>&nbsp;&nbsp;&nbsp; rcSrc.SetRect(0, 0, m_bmpMidSize.cx, m_bmpMidSize.cy);<br><br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Iterate and copy the mid part multiple times until we reach the right end.</font><br>&nbsp;&nbsp;&nbsp; for (int partCount = 0; partCount &lt; midPartCount; partCount++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BitBlt(memDC,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcDest.left, rcDest.top, rcDest.Width(), rcDest.Height(), <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srcDCMid,0,0,SRCCOPY);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcDest.left += m_bmpMidSize.cx;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcDest.right+= m_bmpMidSize.cx;<br>&nbsp;&nbsp;&nbsp; } <br><br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Add the last part (right end) to the bitmap.</font><br>&nbsp;&nbsp;&nbsp; CXTPCompatibleDC srcDCRight(pDC, m_hbmpRight);<br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Reset the destination rect with the moved x-coordinate.</font><br>&nbsp;&nbsp;&nbsp; rcDest.left = nTotalWidth - m_bmpRightSize.cx;<br>&nbsp;&nbsp;&nbsp; rcDest.right= nTotalWidth;<br>&nbsp;&nbsp;&nbsp; rcSrc.SetRect(0, 0, m_bmpRightSize.cx, m_bmpRightSize.cy);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Write to the memDC</font><br>&nbsp;&nbsp;&nbsp; BitBlt(memDC, rcDest.left,rcDest.top,rcDest.Width(),rcDest.Height(),srcDCRight,0,0,SRCCOPY);<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; <font color="#006600">/// Replace the image manager with our own:</font><br>&nbsp;&nbsp;&nbsp; InitializeImageManager(); // uses m_bmpCache.<br>&nbsp;&nbsp;&nbsp; SetTheme(xtpPopupThemeCustom);<br>&nbsp;&nbsp;&nbsp; SetBackgroundBitmap(ID_BITMAP_BACKGROUND);<br><br>&nbsp;&nbsp;&nbsp; memDC.SelectObject(pOldBitmap);<br>}<br><br><br>void MyPopupCtrl::InitializeImageManager()<br>{<br>&nbsp;&nbsp;&nbsp; static UINT uiCmds&#091;&#093; = {ID_BITMAP_BACKGROUND};<br><br>&nbsp;&nbsp;&nbsp; if(!m_pImageMgr)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pImageMgr = new CXTPImageManager();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pImageMgr-&gt;SetIcons(m_bmpCache, uiCmds, 1, CSize(0), xtpImageNormal, m_isAlpha);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetImageManager(m_pImageMgr);<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pImageMgr-&gt;RemoveIcon(ID_BITMAP_BACKGROUND);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pImageMgr-&gt;SetIcons(m_bmpCache, uiCmds, 1, CSize(0), xtpImageNormal, m_isAlpha);<br>&nbsp;&nbsp;&nbsp; }<br>}</font><br><br><br><font face="Arial, Helvetica, sans-serif">One last note is that my three HBITMAP parts are actually PNGs and are loaded like the this:<br></font><br><font color="#000099" face="Courier New, Courier, mono">m_hbmpLeft = CXTPImageManagerIcon::LoadBitmapFromResource(MAKEINTRESOURCE(ID_LEFT), &amp;isAlpha);</font><br><br><font face="Arial, Helvetica, sans-serif">Thanks for your time,<br>Peter</font> <br>]]>
   </description>
   <pubDate>Mon, 18 Aug 2008 11:08:53 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=40024&amp;title=crash-in-cxtpimagemanagersplitbitmap#40024</guid>
  </item> 
  <item>
   <title><![CDATA[Crash in CXTPImageManager::SplitBitmap : Hi, Instead of SetIcons(CBitmap&amp;amp;,...)...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=39959&amp;title=crash-in-cxtpimagemanagersplitbitmap#39959</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11838<br /><strong>Posted:</strong> 18 August 2008 at 1:35am<br /><br />Hi,<DIV>Instead of SetIcons(CBitmap&amp;,...)&nbsp; try SetIcons(UINT..) to allow ImageManager manually load this bitmap.</DIV>]]>
   </description>
   <pubDate>Mon, 18 Aug 2008 01:35:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=39959&amp;title=crash-in-cxtpimagemanagersplitbitmap#39959</guid>
  </item> 
  <item>
   <title><![CDATA[Crash in CXTPImageManager::SplitBitmap : Hello,I&amp;#039;m getting an Access...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=39907&amp;title=crash-in-cxtpimagemanagersplitbitmap#39907</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2302">PierreL</a><br /><strong>Subject:</strong> 11838<br /><strong>Posted:</strong> 15 August 2008 at 1:00pm<br /><br /><span id="ToolBar2">Hello,<br><br>I'm getting an Access violation exception in the SplitBitmap function called from the SetIcons(CBitmap&amp;, ...) function. Here are the conditions where this happens:<br><br></span><span id="ToolBar2">&#091;Using ToolkitPro 11.2.2 on XP SP2&#093;<br><br></span><span id="ToolBar2">- OS color quality setting is set to 16 bits<br>- Calling SetIcons(CBitmap&amp;,...) function with a single </span><span id="ToolBar2">32bpp </span><span id="ToolBar2">bitmap creates this access violation at line 3407 (xtpimagemanager.cpp) : <br><b><font face="Courier New, Courier, mono">&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; *pDestBits<em>++ = *pBitsIter++;</font></b><font face="Courier New, Courier, mono"><br><br><br></font>This is <b>not </b>an issue when the OS color quality is set to 32 bits.<br><br>Has anyone encountered this before?<br><br><br>Thanks,<br>Peter.<br><br></span>]]>
   </description>
   <pubDate>Fri, 15 Aug 2008 13:00:51 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11838&amp;PID=39907&amp;title=crash-in-cxtpimagemanagersplitbitmap#39907</guid>
  </item> 
 </channel>
</rss>