<?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 : Loading Theme from other source</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Loading Theme from other source]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 10:14:31 +0000</pubDate>
  <lastBuildDate>Tue, 06 Apr 2010 06:38:23 +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=14652</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[Loading Theme from other source : Sorry, but I can&amp;#039;t solve...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=57939&amp;title=loading-theme-from-other-source#57939</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6026">__BornInUssr__</a><br /><strong>Subject:</strong> 14652<br /><strong>Posted:</strong> 06 April 2010 at 6:38am<br /><br />Sorry, but I can't solve the same problem. Please help!<br /><br />I use next code:<br /><br />hResource = LoadLibrary(sPath);<br />if(hResource)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AfxSetResourceHandle(hResource); <br /><br />After, on my MainFrame called:<br /><br />XTPPaintManager()-&gt;SetTheme(xtpThemeRibbon);<br /><br />And this call brings me to the same crash in Codejock.]]>
   </description>
   <pubDate>Tue, 06 Apr 2010 06:38:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=57939&amp;title=loading-theme-from-other-source#57939</guid>
  </item> 
  <item>
   <title><![CDATA[Loading Theme from other source : Try making hModule a member variable...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50542&amp;title=loading-theme-from-other-source#50542</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1">kstowell</a><br /><strong>Subject:</strong> 14652<br /><strong>Posted:</strong> 01 July 2009 at 11:16am<br /><br />Try making hModule a member variable and free it in your dtor, for example: <DIV><BR>.h file:</DIV><DIV><table width="99%"><tr><td><pre class="BBcode">private:</DIV><DIV>&nbsp;&nbsp;&nbsp; HMODULE m_hModule;</pre></td></tr></table></DIV><DIV>.cpp file:<table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>CFoo::CFoo()<BR>{</DIV><DIV>&nbsp;&nbsp;&nbsp; m_hModule = ::LoadLibrary( _T("xyz.dll") );<BR>&nbsp;&nbsp;&nbsp; ASSERT(m_hModule != NULL);</DIV><DIV>}</DIV><DIV>~CFoo::CFoo()<BR>{</DIV><DIV>&nbsp;&nbsp;&nbsp; if (m_hModule)</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ::FreeLibrary(m_hModule);</DIV><DIV>}</DIV><DIV>BOOL CFoo::SelectTheme()<BR>{<BR>&nbsp;&nbsp;&nbsp; if (m_hModule)<BR>&nbsp;&nbsp;&nbsp; {</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPPaintManager* pPaintManager = XTPPaintManager();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pPaintManager &amp;&amp;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pPaintManager-&gt;GetCurrentTheme() == xtpThemeOffice2007 ||<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;pPaintManager-&gt;GetCurrentTheme() == xtpThemeRibbon)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;{<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;CXTPOffice2007Theme&amp; pOffice2007PaintManager = *static_cast&lt;CXTPOffice2007Theme*&gt;(pPaintManager);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;pOffice2007PaintManager.SetImageHandle(m_hModule, style.GetResourceName() );</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return TRUE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;&nbsp; }</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; return FALSE;<BR>}</pre></td></tr></table></DIV>]]>
   </description>
   <pubDate>Wed, 01 Jul 2009 11:16:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50542&amp;title=loading-theme-from-other-source#50542</guid>
  </item> 
  <item>
   <title><![CDATA[Loading Theme from other source : What do you mean?Should I free...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50538&amp;title=loading-theme-from-other-source#50538</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3301">Michl</a><br /><strong>Subject:</strong> 14652<br /><strong>Posted:</strong> 01 July 2009 at 8:16am<br /><br />What do you mean?<br>Should I free library at shut down? I thought the resources will be load into memory?<br><br>It would be nice to set an resource handle before first time the resources will be loaded.]]>
   </description>
   <pubDate>Wed, 01 Jul 2009 08:16:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50538&amp;title=loading-theme-from-other-source#50538</guid>
  </item> 
  <item>
   <title><![CDATA[Loading Theme from other source : Hi,  Guess problem in FreeLibrary(...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50533&amp;title=loading-theme-from-other-source#50533</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 14652<br /><strong>Posted:</strong> 01 July 2009 at 8:06am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Guess problem in FreeLibrary( hModule ); you call.</DIV>]]>
   </description>
   <pubDate>Wed, 01 Jul 2009 08:06:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50533&amp;title=loading-theme-from-other-source#50533</guid>
  </item> 
  <item>
   <title><![CDATA[Loading Theme from other source : Hi,how is it possible to load...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50493&amp;title=loading-theme-from-other-source#50493</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3301">Michl</a><br /><strong>Subject:</strong> 14652<br /><strong>Posted:</strong> 30 June 2009 at 4:09am<br /><br />Hi,<br><br>how is it possible to load themes from an external dll?<br><br><table width="99%"><tr><td><pre class="BBcode"><br>CXTPOffice2007Images::CXTPOffice2007Images()<br>{<br>&nbsp;&nbsp;&nbsp; m_mapImages.InitHashTable(XTP_OFFICE2007_IMAGES_HASH_TABLE_SIZE, FALSE);<br><br>&nbsp;&nbsp;&nbsp; m_bFreeOnRelease = FALSE;<br>&nbsp;&nbsp;&nbsp; m_hResource = 0;<br>&nbsp;&nbsp;&nbsp; m_lpTextFile = 0;<br>&nbsp;&nbsp;&nbsp; m_lpTextFileEnd = 0;<br>&nbsp;&nbsp;&nbsp; m_pConnection = NULL;<br><br>&nbsp;&nbsp;&nbsp; <font color="#ff0000">SetHandle(AfxGetInstanceHandle());</font><br><br>&nbsp;&nbsp;&nbsp; m_pLayerBits = NULL;<br>&nbsp;&nbsp;&nbsp; m_hbmLayer = CXTPImageManager::Create32BPPDIBSection(NULL, 512, 512, (LPBYTE*)&amp;m_pLayerBits);<br><br>&nbsp;&nbsp;&nbsp; HDC hdcScreen = ::GetDC(HWND_DESKTOP);<br>&nbsp;&nbsp;&nbsp; m_dc.Attach(::CreateCompatibleDC(hdcScreen));<br>&nbsp;&nbsp;&nbsp; ReleaseDC(HWND_DESKTOP, hdcScreen);<br><br>&nbsp;&nbsp;&nbsp; ::InitializeCriticalSection(&amp;m_cs);<br>}<br></pre></td></tr></table><br>This code expects the theme resources in the executable.<br><br>My resolution was after selecting theme:<br><table width="99%"><tr><td><pre class="BBcode"><br>&nbsp;&nbsp;&nbsp; HMODULE hModule = LoadLibrary( _T("xyz.dll") );<br>&nbsp;&nbsp;&nbsp; ASSERT( hModule );<br>&nbsp;&nbsp;&nbsp; if (!hModule)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return false;<br><br>&nbsp;&nbsp;&nbsp; CXTPPaintManager* pPaintManager = XTPPaintManager();<br>&nbsp;&nbsp;&nbsp; if (pPaintManager &amp;&amp;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pPaintManager-&gt;GetCurrentTheme() == xtpThemeOffice2007 ||<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pPaintManager-&gt;GetCurrentTheme() == xtpThemeRibbon)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPOffice2007Theme&amp; pOffice2007PaintManager = *static_cast&lt;CXTPOffice2007Theme*&gt;(pPaintManager);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pOffice2007PaintManager.SetImageHandle( hModule, style.GetResourceName() );<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; FreeLibrary( hModule );<br></pre></td></tr></table><br><br>This seems to work. But with current release, this runs into the warning:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>void CXTPOffice2007Images::AssertValid()<br>{<br>&nbsp;&nbsp;&nbsp; if (IsValid())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br><br>&nbsp;<font color="#ff0000">&nbsp;&nbsp; XT_ERROR_MSG(<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "Error Locating Office2007 Resources.\n\n"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "Make sure you have included the resources to your project's .rc2 file. For example to provide\n"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "support for Office 2007 Black Visual Style by adding the following line to your project .rc2 file:\n\n"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "#include &lt;Styles/Office2007Black/Office2007Black.rc&gt; to your project .rc2 file.\n\n"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "Giving you access to the Office 2007 resources.");<br></font>}<br></pre></td></tr></table><br><br>Temporarly I documented out this code, but is there a better way to resolve this problem?<br><br>Thanks<br>]]>
   </description>
   <pubDate>Tue, 30 Jun 2009 04:09:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14652&amp;PID=50493&amp;title=loading-theme-from-other-source#50493</guid>
  </item> 
 </channel>
</rss>