<?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 : Use SetTheme in DLL</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Use SetTheme in DLL]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 19:41:28 +0000</pubDate>
  <lastBuildDate>Thu, 25 Aug 2005 07:41:37 +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=2736</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[Use SetTheme in DLL : that make sense! but my problemhaven&amp;#039;tappear...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8335&amp;title=use-settheme-in-dll#8335</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1402">Robby</a><br /><strong>Subject:</strong> 2736<br /><strong>Posted:</strong> 25 August 2005 at 7:41am<br /><br /><P>that make sense!</P><P>but my problem&nbsp;haven't&nbsp;appear for several days ,i do nothing .</P><P>it's amazing....</P><P>anyway thank you for your explicit reply</P>]]>
   </description>
   <pubDate>Thu, 25 Aug 2005 07:41:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8335&amp;title=use-settheme-in-dll#8335</guid>
  </item> 
  <item>
   <title><![CDATA[Use SetTheme in DLL : I had a similar problem with version...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8268&amp;title=use-settheme-in-dll#8268</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1284">franji1</a><br /><strong>Subject:</strong> 2736<br /><strong>Posted:</strong> 22 August 2005 at 3:54pm<br /><br /><P>I had a similar problem with version 8.6, which has to do NOT&nbsp;with when the DLL that "new"ed the specific custom theme, but with WHERE the constructor/destructor code of the custom theme is located.&nbsp; In my case, the custom theme code is IN A DLL - this is BAD, as I will describe below.</P><P>The "global theme manager" is a static? global? object that gets "free"ed when the .EXE shuts down (I can't remember the specific call, but basically the C++ startup/shutdown code calls the destructors of all "global/static" objects at shutdown).&nbsp; Regardless, the .DLL that has the code for the custom theme is now UNLOADED when the global theme manager is destroyed.&nbsp; What's the big deal?&nbsp; The deal is that the destructor of a theme is VIRTUAL, hence when the code in the global theme manger that deletes this custom theme is CALLED, the DLL that this virtual function pointed to is now GONE!</P><P>The "correct" fix is to implement ALL custom themes in the main .EXE, but I wanted mine in a DLL for reasons that are only valid to me, cuz sometimes I like it that way <IMG src="http://forum.codejock.com/smileys/smiley2.gif" border="0">&nbsp;</P><P>My fix for shutting down with custom themes implemented in a DLL, though crude, works.&nbsp; "Standard" themes do not have this problem because their code is still "in memory" (even though we use the XTP as a DLL?!?).&nbsp; Anyway, all I do is call CXTPPaintManager::SetTheme(xtpThemeOfficeXP) first thing in the OnDestroy of my main CFrameWnd dervied window.&nbsp;This causes the current theme to be swapped out with one of the "predefined" themes at the last possible moment. The previous theme's destructor is called while its code is still loaded, hence no crash at shutdown!</P>]]>
   </description>
   <pubDate>Mon, 22 Aug 2005 15:54:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8268&amp;title=use-settheme-in-dll#8268</guid>
  </item> 
  <item>
   <title><![CDATA[Use SetTheme in DLL : thank you for your reply. it&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8216&amp;title=use-settheme-in-dll#8216</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1402">Robby</a><br /><strong>Subject:</strong> 2736<br /><strong>Posted:</strong> 18 August 2005 at 9:23am<br /><br /><P>thank you for your reply.</P><P>it's a mfc dll. just some dialog things,i have checked sample for several times.</P><P>may be i should check again<IMG src="http://forum.codejock.com/smileys/smiley19.gif" border="0">. </P>]]>
   </description>
   <pubDate>Thu, 18 Aug 2005 09:23:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8216&amp;title=use-settheme-in-dll#8216</guid>
  </item> 
  <item>
   <title><![CDATA[Use SetTheme in DLL : 2005-08-18_061524_demo.zip Check...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8211&amp;title=use-settheme-in-dll#8211</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2736<br /><strong>Posted:</strong> 18 August 2005 at 6:15am<br /><br /><P><A href="http://forum.codejock.com/uploads/oleg/2005-08-18_061524_demo.zip" target="_blank">2005-08-18_061524_demo.zip</A></P><P>Check sample. DOn't see any assert errors :(</P>]]>
   </description>
   <pubDate>Thu, 18 Aug 2005 06:15:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8211&amp;title=use-settheme-in-dll#8211</guid>
  </item> 
  <item>
   <title><![CDATA[Use SetTheme in DLL : Thank you for details, we will...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8207&amp;title=use-settheme-in-dll#8207</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2736<br /><strong>Posted:</strong> 18 August 2005 at 4:15am<br /><br /><P>Thank you for details, we will try to reproduce it to find solution for you. </P><P>Any hints what is your dll is? (MFC extension, MFC dll, simple Win32 dll)</P>]]>
   </description>
   <pubDate>Thu, 18 Aug 2005 04:15:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8207&amp;title=use-settheme-in-dll#8207</guid>
  </item> 
  <item>
   <title><![CDATA[Use SetTheme in DLL : the error says  debug assertion...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8196&amp;title=use-settheme-in-dll#8196</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1402">Robby</a><br /><strong>Subject:</strong> 2736<br /><strong>Posted:</strong> 17 August 2005 at 9:06pm<br /><br /><P>the error says </P><P>debug assertion failed</P><P>in xtthememanager.cpp</P><P>i debug the code found that</P><P>the error happened in</P><P>CXTThemeManager::~CXTThemeManager()<BR>{<BR>&nbsp;POSITION pos = m_mapDefaultFactories.GetStartPosition();<BR>&nbsp;void* pThemeFactoryClass;<BR>&nbsp;CXTThemeManagerStyleFactory* pFactory = 0;<BR>&nbsp;while(pos)<BR>&nbsp;{<BR>&nbsp;&nbsp;m_mapDefaultFactories.GetNextAssoc(pos, pThemeFactoryClass, (void *&amp;)pFactory);<BR>&nbsp;&nbsp;delete pFactory;<BR>&nbsp;}</P><P><strong><FONT color=#ff0000>&nbsp;ASSERT(m_factoryList.m_pHead == 0); //here</FONT></strong><BR>&nbsp;m_factoryList.RemoveAll();<BR>}</P>]]>
   </description>
   <pubDate>Wed, 17 Aug 2005 21:06:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8196&amp;title=use-settheme-in-dll#8196</guid>
  </item> 
  <item>
   <title><![CDATA[Use SetTheme in DLL : myprogram will show a regular...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8181&amp;title=use-settheme-in-dll#8181</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1402">Robby</a><br /><strong>Subject:</strong> 2736<br /><strong>Posted:</strong> 17 August 2005 at 9:32am<br /><br /><P>&nbsp;my&nbsp;program will show a regular dialog, it's a normal cdialog,and it has a cbotton control, press this button will show another&nbsp;cdialog,this dialog is defined in my dll.</P><P>&nbsp;in this dialog,I add a cxtbotton to it, and&nbsp; then m_button.SetTheme(new CXTButtonThemeOfficeXP(TRUE)). </P><P>&nbsp;it's ok when i show this dialog,the theme looks nice,but when i quit the program , an error occured,i'm sorry i can't remember the detail infomation about this error. this error occured both in dynamic link with mfc dll and static link with mfc.&nbsp;i test in a normal dialog program(normal means i build an .exe program not .dll),it works well. </P><P>i&nbsp; just wanta know is there anything i should do when i use settheme function in my dll?</P><P>any advice would be appreciated!</P><P>P.S: i&nbsp; use XT pro and VC6</P><span style="font-size:10px"><br /><br />Edited by Robby</span>]]>
   </description>
   <pubDate>Wed, 17 Aug 2005 09:32:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2736&amp;PID=8181&amp;title=use-settheme-in-dll#8181</guid>
  </item> 
 </channel>
</rss>