<?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 : Load Logo is error.</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Load Logo is error.]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 10:13:07 +0000</pubDate>
  <lastBuildDate>Wed, 01 Oct 2008 03:57:22 +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=12280</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[Load Logo is error. : Hi;as Oleg explained, you call...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41538&amp;title=load-logo-is-error#41538</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 12280<br /><strong>Posted:</strong> 01 October 2008 at 3:57am<br /><br />Hi;<br><br>as Oleg explained, you call GetDC() in UpdateLogoImage() but never call ReleaseDC():<br><br><div>void ::<font color="#000000">UpdateLogoImage</font>()<br>{<br>&nbsp;RepositionBars( AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0 );</div><div>&nbsp;if(m_imgLogo.GetSafeHwnd()) {<br>&nbsp;&nbsp;RECT r;<br>&nbsp;&nbsp;GetClientRect(&amp;r);</div><div>&nbsp;&nbsp;m_imgLogo.SetBitmap(NULL);</div><div>&nbsp;&nbsp;BITMAP bmLogo;<br>&nbsp;&nbsp;m_bmpLogo.GetBitmap(&amp;bmLogo);</div><div>&nbsp;&nbsp;int nWidth = r.right - r.left;<br>&nbsp;&nbsp;int nHeight = bmLogo.bmHeight;</div><div>&nbsp;&nbsp;CBitmap bmpNew;<br>&nbsp;&nbsp;bmpNew.CreateCompatibleBitmap(<b><font color="#990000">GetDC()</font></b>, nWidth, nHeight);</div><div>&nbsp;&nbsp;CDC dcBmpSrc;<br>&nbsp;&nbsp;if(dcBmpSrc.CreateCompatibleDC(NULL)) {<br>&nbsp;&nbsp;&nbsp;dcBmpSrc.SelectObject(m_bmpLogo);</div><div>&nbsp;&nbsp;&nbsp;CDC dcBmpNew;<br>&nbsp;&nbsp;&nbsp;if(dcBmpNew.CreateCompatibleDC(NULL)) {<br>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.SelectObject(bmpNew);</div><div>&nbsp;&nbsp;&nbsp;&nbsp;BITMAP bmSrc;<br>&nbsp;&nbsp;&nbsp;&nbsp;m_bmpLogo.GetBitmap(&amp;bmSrc);</div><div>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.FillRect(CRect(0, 0, nWidth, nHeight), &amp;CBrush((COLORREF)0xffffff));<br>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.BitBlt(nWidth - bmSrc.bmWidth, 0, bmSrc.bmWidth, bmSrc.bmHeight, &amp;dcBmpSrc, 0, 0, SRCCOPY);</div><div>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.DeleteDC();</div><div>&nbsp;&nbsp;&nbsp;&nbsp;m_imgLogo.SetBitmap(bmpNew);&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;dcBmpSrc.DeleteDC();<br>&nbsp;&nbsp;}<br>&nbsp;}<br>}</div><br>]]>
   </description>
   <pubDate>Wed, 01 Oct 2008 03:57:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41538&amp;title=load-logo-is-error#41538</guid>
  </item> 
  <item>
   <title><![CDATA[Load Logo is error. : hi Oleg, add ReleaseDC in OnPaint:...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41492&amp;title=load-logo-is-error#41492</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4581">homaas</a><br /><strong>Subject:</strong> 12280<br /><strong>Posted:</strong> 30 September 2008 at 12:45am<br /><br /><P>hi Oleg,</P><DIV>add ReleaseDC in OnPaint: but not display logo</DIV><DIV>&nbsp;</DIV><DIV>void ::<FONT color=#ff0000>OnPaint</FONT>()<BR>{<BR>&nbsp;CPaintDC dc(this);<BR>&nbsp;HDC hdc=dc.GetSafeHdc();</DIV><DIV>&nbsp;UpdateLogoImage();</DIV><DIV>&nbsp;::ReleaseDC(GetSafeHwnd(),hdc);</DIV><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>if I comment GetDC&nbsp;call in OnPaint is not display logo.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>call UpdateLogoImage() int Onsize();</DIV><DIV>&nbsp;</DIV><DIV>void ::<FONT color=#ff0000>OnSize</FONT>(UINT nType, int cx, int cy)<BR>{&nbsp;<BR>&nbsp;CXTPDialogBase&lt;CXTResizeDialog&gt;::OnSize(nType, cx, cy);<BR>&nbsp;UpdateLogoImage();&nbsp;</DIV><DIV>}</DIV>]]>
   </description>
   <pubDate>Tue, 30 Sep 2008 00:45:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41492&amp;title=load-logo-is-error#41492</guid>
  </item> 
  <item>
   <title><![CDATA[Load Logo is error. : Hi, You call GetDC but not ReleaseDC,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41455&amp;title=load-logo-is-error#41455</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 12280<br /><strong>Posted:</strong> 29 September 2008 at 4:12am<br /><br /><DIV>Hi,</DIV><DIV>You call GetDC but not ReleaseDC, you call GetDC in OnPaint handler.</DIV><DIV>&nbsp;</DIV><DIV>Comment this call in OnPaint. better move it to OnSize. and dont' forget add ReleaseDC.</DIV>]]>
   </description>
   <pubDate>Mon, 29 Sep 2008 04:12:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41455&amp;title=load-logo-is-error#41455</guid>
  </item> 
  <item>
   <title><![CDATA[Load Logo is error. : code for load Logo Image:   Bool...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41449&amp;title=load-logo-is-error#41449</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4581">homaas</a><br /><strong>Subject:</strong> 12280<br /><strong>Posted:</strong> 29 September 2008 at 3:13am<br /><br /><strong>code for load Logo Image:</strong><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Bool :: <FONT color=#ff0000>OnInitDialog</FONT>()</DIV><DIV>{</DIV><DIV>VERIFY(m_bmpLogo.LoadBitmap(IDB_LOGO));<BR>&nbsp;BITMAP bm;<BR>&nbsp;m_bmpLogo.GetBitmap(&amp;bm);<BR>&nbsp;m_imgLogo.Create(NULL, WS_CHILD|WS_VISIBLE|SS_BITMAP|SS_CENTERIMAGE, CRect(0, 0, 0, bm.bmHeight), this);&nbsp;</DIV><DIV>&nbsp;if(!m_wndReBar.Create(this, 0)<BR>&nbsp;&nbsp; || !m_wndReBar.AddBar(&amp;m_imgLogo, NULL, NULL, RBBS_NOGRIPPER | RBBS_FIXEDBMP | RBBS_FIXEDSIZE)) {<BR>&nbsp;&nbsp;&nbsp;return -1;<BR>&nbsp;}<BR>&nbsp;UpdateLogoImage();</DIV><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>/////////</DIV><DIV>void ::<FONT color=#ff0000>OnPaint</FONT>()<BR>{<BR>&nbsp;CPaintDC dc(this);&nbsp;<BR>&nbsp;UpdateLogoImage();<BR>}</DIV><DIV>////////</DIV><DIV>&nbsp;</DIV><DIV>void ::<FONT color=#ff0000>UpdateLogoImage</FONT>()<BR>{<BR>&nbsp;RepositionBars( AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0 );</DIV><DIV>&nbsp;if(m_imgLogo.GetSafeHwnd()) {<BR>&nbsp;&nbsp;RECT r;<BR>&nbsp;&nbsp;GetClientRect(&amp;r);</DIV><DIV>&nbsp;&nbsp;m_imgLogo.SetBitmap(NULL);</DIV><DIV>&nbsp;&nbsp;BITMAP bmLogo;<BR>&nbsp;&nbsp;m_bmpLogo.GetBitmap(&amp;bmLogo);</DIV><DIV>&nbsp;&nbsp;int nWidth = r.right - r.left;<BR>&nbsp;&nbsp;int nHeight = bmLogo.bmHeight;</DIV><DIV>&nbsp;&nbsp;CBitmap bmpNew;<BR>&nbsp;&nbsp;bmpNew.CreateCompatibleBitmap(GetDC(), nWidth, nHeight);</DIV><DIV>&nbsp;&nbsp;CDC dcBmpSrc;<BR>&nbsp;&nbsp;if(dcBmpSrc.CreateCompatibleDC(NULL)) {<BR>&nbsp;&nbsp;&nbsp;dcBmpSrc.SelectObject(m_bmpLogo);</DIV><DIV>&nbsp;&nbsp;&nbsp;CDC dcBmpNew;<BR>&nbsp;&nbsp;&nbsp;if(dcBmpNew.CreateCompatibleDC(NULL)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.SelectObject(bmpNew);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;BITMAP bmSrc;<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_bmpLogo.GetBitmap(&amp;bmSrc);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.FillRect(CRect(0, 0, nWidth, nHeight), &amp;CBrush((COLORREF)0xffffff));<BR>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.BitBlt(nWidth - bmSrc.bmWidth, 0, bmSrc.bmWidth, bmSrc.bmHeight, &amp;dcBmpSrc, 0, 0, SRCCOPY);</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;dcBmpNew.DeleteDC();</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;m_imgLogo.SetBitmap(bmpNew);&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;dcBmpSrc.DeleteDC();<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 29 Sep 2008 03:13:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41449&amp;title=load-logo-is-error#41449</guid>
  </item> 
  <item>
   <title><![CDATA[Load Logo is error. : I want load logo as image below  I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41443&amp;title=load-logo-is-error#41443</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4581">homaas</a><br /><strong>Subject:</strong> 12280<br /><strong>Posted:</strong> 28 September 2008 at 10:54pm<br /><br />I want load logo as image below<DIV>&nbsp;</DIV><DIV>I want load logo for dialog with toolbar (not Ribbonbar) ,it ok in WinXP,winVista, but it not display logo in Win98, please help me.</DIV><DIV>&nbsp;</DIV><DIV><img src="https://forum.codejock.com/uploads/20080915_041444_can-error.png" border="0"></DIV>]]>
   </description>
   <pubDate>Sun, 28 Sep 2008 22:54:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12280&amp;PID=41443&amp;title=load-logo-is-error#41443</guid>
  </item> 
 </channel>
</rss>