<?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 : Ribbon problem</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Ribbon problem]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 17:30:31 +0000</pubDate>
  <lastBuildDate>Wed, 25 Apr 2007 16:04:33 +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=6974</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[Ribbon problem : Hi  The new version is below...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22321&amp;title=ribbon-problem#22321</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2928">terrym</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 4:04pm<br /><br />Hi<DIV>&nbsp;</DIV><DIV>The new version is below same applies, we are creating the object using CreateCompatibleBitmap which according to microsoft doesn't need to have it's object selected, however I did try this and still same black square, I have sent the project to you via priority support to show you the problem.</DIV><DIV>&nbsp;</DIV><DIV>Thanks for the help</DIV><DIV>Terry</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#010001 size=2><P>HBITMAP</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> = (</FONT><FONT color=#010001 size=2>HBITMAP</FONT><FONT size=2>)::</FONT><FONT color=#010001 size=2>LoadImage</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2>"c:\\1.bmp"</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>IMAGE_BITMAP</FONT><FONT size=2>, 0, 0, </FONT><FONT color=#010001 size=2>LR_CREATEDIBSECTION</FONT><FONT size=2> | </FONT><FONT color=#010001 size=2>LR_LOADFROMFILE</FONT><FONT size=2> );</P></FONT><FONT color=#0000ff size=2><P>if</FONT><FONT size=2> ( </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> == </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> ) </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2>;</P></FONT><FONT color=#010001 size=2><P>CDC</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2>;</P></FONT><FONT color=#010001 size=2><P>CDC</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pDestinationDC</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2>;</P></FONT><FONT color=#010001 size=2><P>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pSourceBitmap</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2>;</P></FONT><FONT color=#010001 size=2><P>pSourceBitmap</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>Attach</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> );</P></FONT><FONT color=#010001 size=2><P>pSourceDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleDC</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> );</P></FONT><FONT color=#010001 size=2><P>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pOldSourceBitmap</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pSourceBitmap</FONT><FONT size=2> );</P></FONT><FONT color=#010001 size=2><P>pDestinationDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleDC</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> );</P></FONT><FONT color=#010001 size=2><P>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2>;</P></FONT><FONT color=#010001 size=2><P>pDestinationBitmap</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleBitmap</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>, 48, 48 );</P></FONT><FONT color=#010001 size=2><P>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pOldDestinationBitmap</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2> );</P></FONT><FONT color=#010001 size=2><P>pDestinationDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>StretchBlt</FONT><FONT size=2>( 0, 0, 48, 48, </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>, 0, 0, 300, 300, </FONT><FONT color=#010001 size=2>SRCCOPY</FONT><FONT size=2> );</P></FONT><FONT color=#010001 size=2><P>pSourceDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pOldSourceBitmap</FONT><FONT size=2>);</P></FONT><FONT color=#0000ff size=2><P>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>;</P></FONT><FONT color=#010001 size=2><P>m_ImageList</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>Add</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>m_crMaskColour</FONT><FONT size=2> );</P></FONT><FONT color=#010001 size=2><P>pDestinationDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pOldDestinationBitmap</FONT><FONT size=2> );</P></FONT><FONT color=#0000ff size=2><P>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pDestinationDC</FONT><FONT size=2>;</P></FONT><FONT color=#0000ff size=2><P>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2>;</P></FONT><FONT color=#0000ff size=2><P>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pSourceBitmap</FONT><FONT size=2>;</P></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 16:04:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22321&amp;title=ribbon-problem#22321</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : Hi, You didn&amp;#039;t select pDestinationBitmap...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22314&amp;title=ribbon-problem#22314</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 1:19pm<br /><br /><DIV>Hi,</DIV><DIV>You didn't select <FONT color=#010001 size=2>pDestinationBitmap to pDestinationDC...</DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>You don't need to much new/delete create them in heap:</DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>CDC dcSrc;</DIV><DIV>dcSrc.CreateCompatibleDC(NULL)</DIV><DIV>etc</DIV></FONT>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 13:19:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22314&amp;title=ribbon-problem#22314</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : Hi  Ok that works fine until...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22305&amp;title=ribbon-problem#22305</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2928">terrym</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 8:52am<br /><br />Hi<DIV>&nbsp;</DIV><DIV>Ok that works fine until we then create a 2nd DC with a compatible bitmap so we can then stretchblt to other DC to create our item (thumbnail), the code is as follows:</DIV><DIV>&nbsp;</DIV><FONT size=2><P></FONT><FONT color=#010001 size=2>HBITMAP</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> = (</FONT><FONT color=#010001 size=2>HBITMAP</FONT><FONT size=2>)::</FONT><FONT color=#010001 size=2>LoadImage</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2>"c:\\1.bmp"</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>IMAGE_BITMAP</FONT><FONT size=2>, 0, 0, </FONT><FONT color=#010001 size=2>LR_CREATEDIBSECTION</FONT><FONT size=2> | </FONT><FONT color=#010001 size=2>LR_LOADFROMFILE</FONT><FONT size=2> );</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> ( </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> == </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> ) </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pDestinationDC</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pSourceBitmap</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>pSourceBitmap</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>Attach</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> );</P><P></FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleDC</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> );</P><P></FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pOldSourceBitmap</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pSourceBitmap</FONT><FONT size=2> );</P><P></FONT><FONT color=#010001 size=2>pDestinationDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleDC</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> );</P><P></FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleBitmap</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>, 48, 48 );</P><P></FONT><FONT color=#010001 size=2>pDestinationDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>StretchBlt</FONT><FONT size=2>( 0, 0, 48, 48, </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>, 0, 0, 300, 300, </FONT><FONT color=#010001 size=2>SRCCOPY</FONT><FONT size=2> );</P><P></FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pOldSourceBitmap</FONT><FONT size=2>);</P><P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pSourceDC</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>m_ImageList</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>Add</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>m_crMaskColour</FONT><FONT size=2> );</P><P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pDestinationDC</FONT><FONT size=2>;</P><P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pDestinationBitmap</FONT><FONT size=2>;</P><P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>pSourceBitmap</FONT><FONT size=2>;</P><DIV></DIV><P>&nbsp;</P><P>Thanks for help, it is much appreciated.</P><DIV></DIV></FONT>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 08:52:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22305&amp;title=ribbon-problem#22305</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : Hi,  Don&amp;#039;t think problem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22303&amp;title=ribbon-problem#22303</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 8:30am<br /><br /><DIV>Hi,</DIV><DIV>&nbsp;</DIV><DIV>Don't think problem in CreatecompatibleDC&nbsp; line - think ptoblem that you call SelectObject and didn't restore context back.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>try</DIV><DIV>&nbsp;</DIV><DIV><P><FONT color=#010001 size=2>CBitmap* pOldBitmap = pDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2> );</P><DIV>// Make some work</DIV><DIV>&nbsp;</DIV><DIV><strong><FONT color=#010001>pDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( pOldBitmap);</FONT></strong></DIV><DIV><strong></strong>&nbsp;</DIV><DIV><strong>delete pDC;</strong></DIV><DIV></FONT><FONT color=#010001 size=2></FONT>&nbsp;</DIV><DIV><FONT color=#010001 size=2>m_ImageList</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>Add</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>m_crMaskColour</FONT><FONT size=2> );</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>delete <FONT color=#010001>pBitmap;</FONT></FONT></DIV></DIV>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 08:30:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22303&amp;title=ribbon-problem#22303</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : The problem seems to be that we...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22302&amp;title=ribbon-problem#22302</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2928">terrym</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 8:22am<br /><br />The problem seems to be that we are passing NULL when we create compatible DC, and even thou we are attaching the bitmap it is not setting up this DC correctly.&nbsp; Any ideas on what else we can pass ?<DIV>&nbsp;</DIV><DIV>Any help appreciated, even willing to pay somebody to help us fix this as urgent for a projecct.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 08:22:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22302&amp;title=ribbon-problem#22302</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : Hi  We load our images from...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22300&amp;title=ribbon-problem#22300</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2928">terrym</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 8:08am<br /><br />Hi<DIV>&nbsp;</DIV><DIV>We load our images from disk then we resize them or add text etc. to each one, so we may need more images, but first we have to create a compatible DC so we can edit the images or add text.</DIV><DIV>&nbsp;</DIV><DIV>This is the problem :(</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV><DIV>Terry</DIV>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 08:08:53 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22300&amp;title=ribbon-problem#22300</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : Hi  The problem is we need to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22299&amp;title=ribbon-problem#22299</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2928">terrym</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 8:06am<br /><br /><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2">Hi<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2">The problem is we need to use the DC because we want to edit the bitmap, eg. Resize or add text before it is added to gallery control<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2">Thanks<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2">Terry<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 08:06:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22299&amp;title=ribbon-problem#22299</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : ps: You don&amp;#039;t need these...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22298&amp;title=ribbon-problem#22298</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 8:04am<br /><br />ps: You don't need these lines to convert hbitmap to CBitmap:<DIV><FONT size=2><P></FONT><EM><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CBitmap</FONT></EM><FONT size=2><EM>;</EM></P><P></FONT><EM><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>Attach</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>hBitmap</FONT></EM><FONT size=2><EM> );</EM></P><P></FONT><EM><FONT color=#010001 size=2>CDC</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pDC</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CDC</FONT></EM><FONT size=2><EM>;</EM></P><P></FONT><EM><FONT color=#010001 size=2>pDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleDC</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT></EM><FONT size=2><EM> ); // this line seems to make it fail</EM></P><P></FONT><EM><FONT color=#010001 size=2>pDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pBitmap</FONT></EM><FONT size=2><EM> );</EM></P><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>just need these:</DIV><DIV>&nbsp;</DIV><DIV><BR><FONT color=#010001 size=2>HBITMAP</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> = (</FONT><FONT color=#010001 size=2>HBITMAP</FONT><FONT size=2>)::</FONT><FONT color=#010001 size=2>LoadImage</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2>"c:\\1.bmp"</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>IMAGE_BITMAP</FONT><FONT size=2>, 0, 0, </FONT><FONT color=#010001 size=2>LR_CREATEDIBSECTION</FONT><FONT size=2> | </FONT><FONT color=#010001 size=2>LR_LOADFROMFILE</FONT><FONT size=2> );</FONT></DIV><DIV>&nbsp;</DIV><DIV>CBitmap bmp;</DIV><DIV>bmp.Attach(hBitmap);</DIV><DIV></FONT>&nbsp;</DIV></DIV>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 08:04:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22298&amp;title=ribbon-problem#22298</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : Hello,   Instead of converting...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22297&amp;title=ribbon-problem#22297</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 8:02am<br /><br />Hello, <DIV>&nbsp;</DIV><DIV>Instead of converting bitmap to imagelist, you can set bitmap directly - </DIV><DIV>&nbsp;</DIV><DIV>BOOL SetIcons(CBitmap&amp; bmpIcons, UINT* pCommands, int nCount, CSize szIcon, XTPImageState imageState = xtpImageNormal, BOOL bAlpha = FALSE)</DIV>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 08:02:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22297&amp;title=ribbon-problem#22297</guid>
  </item> 
  <item>
   <title><![CDATA[Ribbon problem : We are having a problem with the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22296&amp;title=ribbon-problem#22296</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2928">terrym</a><br /><strong>Subject:</strong> 6974<br /><strong>Posted:</strong> 25 April 2007 at 7:57am<br /><br />We are having a problem with the following code as we want to generate gallery control items on the fly, however once we add the CreateCompatibleDC( NULL ) section it only shows a black square for each gallery control item<DIV></DIV><DIV>&nbsp;</DIV><DIV>Any help would be much appreciated as this code works fine in OnPaint handlers etc.</DIV><DIV>&nbsp;</DIV><DIV>--------<BR><BR><FONT color=#010001 size=2>m_ImageList</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>Create</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>m_nWidth</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>m_nHeight</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>ILC_COLOR32</FONT><FONT size=2> | </FONT><FONT color=#010001 size=2>ILC_MASK</FONT><FONT size=2>, 0, 1 );<BR><BR></FONT><FONT color=#010001 size=2>HBITMAP</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> = (</FONT><FONT color=#010001 size=2>HBITMAP</FONT><FONT size=2>)::</FONT><FONT color=#010001 size=2>LoadImage</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2>"c:\\1.bmp"</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>IMAGE_BITMAP</FONT><FONT size=2>, 0, 0, </FONT><FONT color=#010001 size=2>LR_CREATEDIBSECTION</FONT><FONT size=2> | </FONT><FONT color=#010001 size=2>LR_LOADFROMFILE</FONT><FONT size=2> );</DIV><DIV><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> ( </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> == </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> ) </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CBitmap</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>Attach</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>hBitmap</FONT><FONT size=2> );</P><P></FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2> *</FONT><FONT color=#010001 size=2>pDC</FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>CDC</FONT><FONT size=2>;</P><P></FONT><FONT color=#010001 size=2>pDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>CreateCompatibleDC</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>NULL</FONT><FONT size=2> ); // this line seems to make it fail</P><P></FONT><FONT color=#010001 size=2>pDC</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>SelectObject</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2> );</P><DIV></FONT><FONT color=#010001 size=2>m_ImageList</FONT><FONT size=2>.</FONT><FONT color=#010001 size=2>Add</FONT><FONT size=2>( </FONT><FONT color=#010001 size=2>pBitmap</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>m_crMaskColour</FONT><FONT size=2> );</DIV></FONT></DIV><DIV><BR>--------</DIV><DIV>&nbsp;</DIV><DIV>Thanks for any help, much appreciated.</DIV><DIV>Terry</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 25 Apr 2007 07:57:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6974&amp;PID=22296&amp;title=ribbon-problem#22296</guid>
  </item> 
 </channel>
</rss>