<?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 : GdiPlus Registering Race Condition</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : GdiPlus Registering Race Condition]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 19 Apr 2026 05:24:15 +0000</pubDate>
  <lastBuildDate>Mon, 10 Sep 2018 13:23:15 +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=23703</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[GdiPlus Registering Race Condition : Yes!It&amp;#039;s been my fault......]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77016&amp;title=gdiplus-registering-race-condition#77016</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 23703<br /><strong>Posted:</strong> 10 September 2018 at 1:23pm<br /><br /><div>Yes!</div><div><br></div><div>It's been my fault...<br></div>]]>
   </description>
   <pubDate>Mon, 10 Sep 2018 13:23:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77016&amp;title=gdiplus-registering-race-condition#77016</guid>
  </item> 
  <item>
   <title><![CDATA[GdiPlus Registering Race Condition : Was this problem related to your...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77015&amp;title=gdiplus-registering-race-condition#77015</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=313">Marco1</a><br /><strong>Subject:</strong> 23703<br /><strong>Posted:</strong> 10 September 2018 at 1:21pm<br /><br />Was this problem related to your program?<br>]]>
   </description>
   <pubDate>Mon, 10 Sep 2018 13:21:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77015&amp;title=gdiplus-registering-race-condition#77015</guid>
  </item> 
  <item>
   <title><![CDATA[GdiPlus Registering Race Condition : Fixed it.Thanks for the help!...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77005&amp;title=gdiplus-registering-race-condition#77005</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 23703<br /><strong>Posted:</strong> 05 September 2018 at 6:34am<br /><br />Fixed it.<div>Thanks for the help! :)</div>]]>
   </description>
   <pubDate>Wed, 05 Sep 2018 06:34:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77005&amp;title=gdiplus-registering-race-condition#77005</guid>
  </item> 
  <item>
   <title><![CDATA[GdiPlus Registering Race Condition : Hello,the easiest way would be...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77004&amp;title=gdiplus-registering-race-condition#77004</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 23703<br /><strong>Posted:</strong> 05 September 2018 at 5:27am<br /><br />Hello,<div><br></div><div>the easiest way would be to implement a sample that uses multithreading and do something like the following all the time until you get into the race condition:<div><br></div><div><div><font face="Courier New, Courier, mono">&nbsp; CSampleMarkupView* Wnd_ = new CSampleMarkupView(); <font color="#339900">//Calls CXTPMarkup</font><font color="#009900">DrawingContext::Register(TRUE)&nbsp;-&gt; calls CXTPGdiPlus::Register(TRUE)</font></font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; // with&nbsp;ASSERT(m_nGdiplusToken == 0 &amp;&amp; m_hModule == 0) (XTPGdiPlus.cpp Line 61)</font></div><div><font face="Courier New, Courier, mono">&nbsp;</font></div><div><font face="Courier New, Courier, mono">&nbsp; delete Wnd_;<font color="#009900"> //Calls CXTPMarkupDrawingContext::Register(FALSE) -&gt; calls CXTPGdiPlus::Register(FALSE)</font></font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; /*</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; XTPGdiPlus.cpp Line 75ff:</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; m_nCount--;</font></div><div><font color="#009900" face="Courier New, Courier, mono"><br></font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; if (m_nCount != 0)</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; return;</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; -----------------&gt; if another thread that wants to call CXTPMarkupDrawingContext::Register(TRUE) interrupts our thread we got an assertion (ASSERT(m_nGdiplusToken == 0 &amp;&amp; m_hModule == 0)) in XTPGdiPlus.cpp Line 61</font></div><div><font color="#009900" face="Courier New, Courier, mono"><br></font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; if (m_hModule)</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; {</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; // Termination of background thread, which is causing the shutdown problem.</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; gdiplusStartupOutput.NotificationUnhook(m_nGdiplusToken);</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; GdiplusShutdown(m_nGdiplusToken);</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; &nbsp; FreeLibrary(m_hModule);</font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp; }</font></div><div><font color="#009900" face="Courier New, Courier, mono"><div>&nbsp; &nbsp; &nbsp; m_hModule = NULL;</div><div>&nbsp; &nbsp; &nbsp; m_nGdiplusToken = 0;</div></font></div><div><font color="#009900" face="Courier New, Courier, mono">&nbsp; &nbsp;*/</font></div></div><div><font color="#009900"><br></font></div><div><font color="#009900"><br></font></div><div>using:</div><div><div><font face="Courier New, Courier, mono">class CSampleMarkupView : public CWnd, CXTPMarkupContext {</font></div><div><font face="Courier New, Courier, mono">public:</font></div><div><font face="Courier New, Courier, mono">&nbsp; CSampleMarkupView() : CWnd(), CXTPMarkupContext() {}</font></div><div><font face="Courier New, Courier, mono">&nbsp; virtual ~CSampleMarkupView() {}</font></div><div><font face="Courier New, Courier, mono">};</font></div></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">Best regards</font></div><div><br></div></div>]]>
   </description>
   <pubDate>Wed, 05 Sep 2018 05:27:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77004&amp;title=gdiplus-registering-race-condition#77004</guid>
  </item> 
  <item>
   <title><![CDATA[GdiPlus Registering Race Condition :  Hello Martin, how I can reproduce...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77003&amp;title=gdiplus-registering-race-condition#77003</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> 23703<br /><strong>Posted:</strong> 05 September 2018 at 3:56am<br /><br /><div>Hello Martin, how I can reproduce it with our samples?</div><div><br></div><div>Regards,</div><div>Artem Gontarenko<br></div>]]>
   </description>
   <pubDate>Wed, 05 Sep 2018 03:56:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77003&amp;title=gdiplus-registering-race-condition#77003</guid>
  </item> 
  <item>
   <title><![CDATA[GdiPlus Registering Race Condition : Hello,when creating two different...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77002&amp;title=gdiplus-registering-race-condition#77002</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 23703<br /><strong>Posted:</strong> 03 September 2018 at 6:07am<br /><br />Hello,<div><br></div><div>when creating two different <b>CXTPMarkupContext</b>s both call in their constructor the function <b>CXTPMarkupDrawingContext::Register(TRUE)</b>. As this leads to a registering of the CXTPSingleton CXTPGdiPlus 2x sometimes an assertion will be caused, when we got a bad timing.</div><div><br></div><div>Can anyone please help me solve this issue by fixing the race condition or telling me if I've used these classes in a wrong way and how to use them correctly?</div><div><br>Thanks for the help in advance.</div>]]>
   </description>
   <pubDate>Mon, 03 Sep 2018 06:07:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23703&amp;PID=77002&amp;title=gdiplus-registering-race-condition#77002</guid>
  </item> 
 </channel>
</rss>