<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#62;devblog_</title>
	<atom:link href="http://devblog.itsth.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.itsth.com</link>
	<description>Thoughts on developing shareware</description>
	<lastBuildDate>Thu, 02 May 2013 11:52:42 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Dangerous MakeLower</title>
		<link>http://devblog.itsth.com/2013/05/02/dangerous-makelower/</link>
		<comments>http://devblog.itsth.com/2013/05/02/dangerous-makelower/#comments</comments>
		<pubDate>Thu, 02 May 2013 11:49:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Dangerous]]></category>
		<category><![CDATA[MakeLower]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=230</guid>
		<description><![CDATA[Got weird crashes at customers with foreign languages? Microsoft&#8217;s MFC&#8217;s MakeLower could be the culprit. Seems to be poorly written because it can crash if it doesn&#8217;t like the string. I could even reproduce it here by switching the Windows-Locale for non-unicode apps the Japanese and process some strings contains German umlauts. Bottom-line? Don&#8217;t use, [...]]]></description>
				<content:encoded><![CDATA[<p>Got weird crashes at customers with foreign languages? Microsoft&#8217;s MFC&#8217;s MakeLower could be the culprit. Seems to be poorly written because it can crash if it doesn&#8217;t like the string. I could even reproduce it here by switching the Windows-Locale for non-unicode apps the Japanese and process some strings contains German umlauts. Bottom-line? Don&#8217;t use, write your own&#8230; <img src='http://devblog.itsth.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2013/05/02/dangerous-makelower/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google correlates with county jail</title>
		<link>http://devblog.itsth.com/2013/03/21/google-correlates-with-county-jail/</link>
		<comments>http://devblog.itsth.com/2013/03/21/google-correlates-with-county-jail/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 19:26:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=223</guid>
		<description><![CDATA[By accident I stumbled across a new Google trick called Google Correlate which looks for data that correlates with the search term that you enter. I didn&#8217;t really know what this is good for, so I just entered &#8220;Google&#8221;. And guess what: Google correlates with county jail. Like all statistical data, it&#8217;s up to the [...]]]></description>
				<content:encoded><![CDATA[<p>By accident I stumbled across a new Google trick called <a href="http://www.google.com/trends/correlate/">Google Correlate</a> which looks for data that correlates with the search term that you enter. I didn&#8217;t really know what this is good for, so I just entered &#8220;Google&#8221;. And guess what: Google correlates with county jail.</p>
<p>Like all statistical data, it&#8217;s up to the reader to interpret it.</p>
<p>&nbsp;</p>
<div class="wp-caption alignnone" style="width: 363px"><a href="http://www.itsth.de/img/blog/GoogleCorrelate.png"><img class="  " alt="" src="http://www.itsth.de/img/blog/GoogleCorrelate.png" width="353" height="308" /></a><p class="wp-caption-text">Google Correlate</p></div>
<p><a href="http://www.itsth.de/images/blog/GoogleCorrelate.png"> </a></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2013/03/21/google-correlates-with-county-jail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Visual Studio 2012&#8230; Safely&#8230;</title>
		<link>http://devblog.itsth.com/2013/01/10/using-visual-studio-2012-safely/</link>
		<comments>http://devblog.itsth.com/2013/01/10/using-visual-studio-2012-safely/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 09:35:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=220</guid>
		<description><![CDATA[Microsoft Visual Studio 2012 isn&#8217;t so bad. I actually even like new dark looks. But (for C++) you shouldn&#8217;t use the default settings, our you&#8217;ll get problems with your older customers. &#160; 1. Making it run with XP Go to &#8220;configuration properties &#62; general&#8221; and switch the &#8220;Platform toolset&#8221; to &#8220;Visual Studio 2012 &#8211; Windows [...]]]></description>
				<content:encoded><![CDATA[<p>Microsoft Visual Studio 2012 isn&#8217;t so bad. <img src='http://devblog.itsth.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  I actually even like new dark looks. But (for C++) you shouldn&#8217;t use the default settings, our you&#8217;ll get problems with your older customers.</p>
<p>&nbsp;</p>
<p>1. Making it run with XP</p>
<p>Go to &#8220;configuration properties &gt; general&#8221; and switch the &#8220;Platform toolset&#8221; to &#8220;Visual Studio 2012 &#8211; Windows XP (v110_xp)&#8221;.</p>
<p>&nbsp;</p>
<p>2. Making it run on older systems</p>
<p>This caused me hours of work. By default VS2012 will &#8220;optimize&#8221; fp-operations. But it doesn&#8217;t work on all systems. Don&#8217;t know if it&#8217;s the older processors but I had at least 2 customers where a simple statement as &#8220;myfpvar=1&#8243; caused the program to terminate without error message. To fix this go to &#8220;C++&gt; Code generation&#8221; and set &#8220;Enable enhanced instruction set&#8221; to &#8220;No Enhanced Instructions (/arch:IA32)&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2013/01/10/using-visual-studio-2012-safely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;It still doesn&#8217;t work&#8221;</title>
		<link>http://devblog.itsth.com/2012/12/12/it-still-doesnt-work/</link>
		<comments>http://devblog.itsth.com/2012/12/12/it-still-doesnt-work/#comments</comments>
		<pubDate>Wed, 12 Dec 2012 11:46:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=217</guid>
		<description><![CDATA[In the past 48 hours I had the same strange effect twice (different products / problems). I wrote the customer three simple (yes, simple! Really!) steps to fix the problem. The answer was in both cases: &#8220;It still doesn&#8217;t work&#8221;. In the end it turned out it both cases that the customer had not done [...]]]></description>
				<content:encoded><![CDATA[<p>In the past 48 hours I had the same strange effect twice (different products / problems). I wrote the customer three simple (yes, simple! Really!) steps to fix the problem. The answer was in both cases: &#8220;It still doesn&#8217;t work&#8221;.</p>
<p>In the end it turned out it both cases that the customer had not done these simple steps or not done them properly or whatever.</p>
<p>For me this means that I should work even even more with log files, configuration files and other &#8220;hard evidence&#8221;. And less with what the customer says&#8230;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2012/12/12/it-still-doesnt-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weird TextOut Unicode problems</title>
		<link>http://devblog.itsth.com/2012/10/26/weird-textout-unicode-problems/</link>
		<comments>http://devblog.itsth.com/2012/10/26/weird-textout-unicode-problems/#comments</comments>
		<pubDate>Fri, 26 Oct 2012 14:10:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=212</guid>
		<description><![CDATA[After porting Easy2Sync for Files to Unicode I experienced some really weird problems with some foreign characters. Unicode in general worked, Japanese characters were displayed nicely (not that I could read them). But Cyrillic characters failed when printed with TextOut and were displayed as small black rectangles. Even weirder: Adding just 1 Japanese character to [...]]]></description>
				<content:encoded><![CDATA[<p>After porting <a href="http://www.easy2sync.com/en/produkte/easy2sync.php">Easy2Sync for Files</a> to Unicode I experienced some really weird problems with some foreign characters. Unicode in general worked, Japanese characters were displayed nicely (not that I could read them). But Cyrillic characters failed when printed with TextOut and were displayed as small black rectangles.</p>
<p><img class="alignnone" title="Unicode problem" src="http://www.itsth.com/img/blog/TextOutUnicode.png" alt="" width="327" height="219" /></p>
<p>Even weirder: Adding just 1 Japanese character to a string with Cyrillic characters caused the <span style="text-decoration: underline;">entire</span> string to be printed right.</p>
<p>It <a href="http://stackoverflow.com/questions/5642228/exttextout-not-displaying-subscript-characters">seems</a> that TextOut is only 50% Unicode compatible (of course Microsoft doesn&#8217;t mention this). So one has to use DrawText instead, which doesn&#8217;t seem to have these limitations. Since DrawText behaves differently regarding the position and background drawing, here&#8217;s a wrapper which fixes this and makes it behave like ExtTextOut:</p>
<pre>void FixedExtTextOut (CDC *pDC, int x, int y, UINT nOptions, LPCRECT lpRect, LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths)
{
 CRect rr(x, y, lpRect-&gt;right, lpRect-&gt;bottom);

 pDC-&gt;FillSolidRect(lpRect, pDC-&gt;GetBkColor());
 pDC-&gt;DrawText(lpszString, nCount, &amp;rr, 0);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2012/10/26/weird-textout-unicode-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You&#8217;re not gonna catch this&#8230;</title>
		<link>http://devblog.itsth.com/2012/06/14/youre-not-gonna-catch-this/</link>
		<comments>http://devblog.itsth.com/2012/06/14/youre-not-gonna-catch-this/#comments</comments>
		<pubDate>Thu, 14 Jun 2012 08:43:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=202</guid>
		<description><![CDATA[C++ exceptions can be surprising. This works easily: try { throw(1); } catch(&#8230;) //Catch all { //caught } But if you replace &#8220;throw(1);&#8221; with &#8220;throw;&#8221;, it suddenly doesn&#8217;t work anymore. Code compiles, exception is thrown, but it&#8217;s not caught. The program is terminated&#8230;]]></description>
				<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 250px"><img title="LIttle League baseball, May 2009 - 03 by Ed Yourdon ( (CC BY-SA 2.0)" src="http://www.itsth.com/img/blog/baseball.jpg" alt="" width="240" height="160" /><p class="wp-caption-text">You&#39;re not gonna catch this... (LIttle League baseball, May 2009 - 03 by Ed Yourdon; CC BY-SA 2.0)</p></div>
<p>C++ exceptions can be surprising. This works easily:</p>
<p>try<br />
{<br />
throw(1);<br />
}<br />
catch(&#8230;) //Catch all<br />
{<br />
//caught<br />
}</p>
<p>But if you replace &#8220;throw(1);&#8221; with &#8220;throw;&#8221;, it suddenly doesn&#8217;t work anymore. Code compiles, exception is thrown, but it&#8217;s not caught. The program is <span style="text-decoration: underline;">terminated</span>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2012/06/14/youre-not-gonna-catch-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MFC: Redirecting OnMouseWheel messages to the window under cursor</title>
		<link>http://devblog.itsth.com/2012/06/06/mfc-redirecting-onmousewheel-messages-to-the-window-under-cursor/</link>
		<comments>http://devblog.itsth.com/2012/06/06/mfc-redirecting-onmousewheel-messages-to-the-window-under-cursor/#comments</comments>
		<pubDate>Wed, 06 Jun 2012 08:51:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[Mouse Wheel]]></category>
		<category><![CDATA[OnMouseWheel]]></category>
		<category><![CDATA[WM_MOUSEHWHEEL]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=197</guid>
		<description><![CDATA[By default MFC applies the MouseWheel message to the window that has the focus. Even though most users expect it to apply to the window under the cursor. (And even Microsoft&#8217;s style guide recommends that.) To fix this, override the program&#8217;s PreTranslateMessage  function and add this: if (pMsg-&#62;message==WM_MOUSEWHEEL) { CPoint point; GetCursorPos (&#38;point); HWND hWnd [...]]]></description>
				<content:encoded><![CDATA[<p>By default MFC applies the MouseWheel message to the window that has the focus. Even though most users expect it to apply to the window under the cursor. (And even Microsoft&#8217;s style guide recommends that.)</p>
<p>To fix this, override the program&#8217;s PreTranslateMessage  function and add this:</p>
<pre> if (pMsg-&gt;message==WM_MOUSEWHEEL)
 {
    CPoint point;
    GetCursorPos (&amp;point);

    HWND hWnd = ::WindowFromPoint (point);

    if (hWnd &amp;&amp; pMsg-&gt;hwnd!=hWnd)
    {
       ::PostMessage(hWnd, pMsg-&gt;message, pMsg-&gt;wParam, pMsg-&gt;lParam);
       return(true);
    }
 }</pre>
<p>Please note that you have to add this  before calling the default implementation of PreTranslateMessage.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2012/06/06/mfc-redirecting-onmousewheel-messages-to-the-window-under-cursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turning off floating point exceptions against crashes</title>
		<link>http://devblog.itsth.com/2012/06/01/turning-off-floating-point-exceptions-against-crashes/</link>
		<comments>http://devblog.itsth.com/2012/06/01/turning-off-floating-point-exceptions-against-crashes/#comments</comments>
		<pubDate>Fri, 01 Jun 2012 09:45:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=193</guid>
		<description><![CDATA[It sounds quite mad, but either of these lines can crash a program: (C++, Visual Studio 2005) long x = long(my_float_var); float f = exp(my_float_var); If the number is too large/small, the program is terminated. (No, try/catch doesn&#8217;t help.) And to make it even stranger, this happens only on some computers. And of course it [...]]]></description>
				<content:encoded><![CDATA[<p>It sounds quite mad, but either of these lines can crash a program: (C++, Visual Studio 2005)</p>
<p>long x = long(my_float_var);<br />
float f = exp(my_float_var);</p>
<p>If the number is too large/small, the program is terminated. (No, try/catch doesn&#8217;t help.) And to make it even stranger, this happens only on some computers. And of course it happened on the customer&#8217;s computer and not on mine&#8230;</p>
<p>To fix this, it helps to turn off the floating point exceptions:<br />
control87(_EM_INVALID|_EM_DENORMAL|_EM_ZERODIVIDE|_EM_OVERFLOW|_EM_UNDERFLOW|_EM_INEXACT, _MCW_EM);</p>
<p>Of course the problem of the large number still exists, but now the program at least continues to run, and I have a chance to handle it.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2012/06/01/turning-off-floating-point-exceptions-against-crashes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes Connect age rating summary</title>
		<link>http://devblog.itsth.com/2012/05/21/itunes-connect-age-rating-summary/</link>
		<comments>http://devblog.itsth.com/2012/05/21/itunes-connect-age-rating-summary/#comments</comments>
		<pubDate>Mon, 21 May 2012 15:08:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[marketing]]></category>
		<category><![CDATA[age rating]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iTunes connect]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=190</guid>
		<description><![CDATA[What items causes which rating with apple? Well, here&#8217;s a summary. Please contact me if I missed anything&#8230;]]></description>
				<content:encoded><![CDATA[<p>What items causes which rating with apple? Well, here&#8217;s a summary. Please contact me if I missed anything&#8230; <img src='http://devblog.itsth.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><img class="alignnone" title="iTunes Connect age rating matrix" src="http://www.itsth.com/img/blog/iTunes-Connect-Age-Rating.png" alt="" width="693" height="490" /></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2012/05/21/itunes-connect-age-rating-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EnumResourceNames + RT_STRING</title>
		<link>http://devblog.itsth.com/2012/05/04/enumresourcenames-rt_string/</link>
		<comments>http://devblog.itsth.com/2012/05/04/enumresourcenames-rt_string/#comments</comments>
		<pubDate>Fri, 04 May 2012 14:19:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[EnumResourceNames]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[RT_STRING]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=187</guid>
		<description><![CDATA[It sounds pretty straightforward to enumerate the resources  in a file. But it turned out to be rather a lot of work (and waste of time), since the MS doesn&#8217;t tell you, that it doesn&#8217;t enumerate the strings, but blocks of strings in a binary format that you have to process yourself. Here&#8217;s how to [...]]]></description>
				<content:encoded><![CDATA[<p>It sounds pretty straightforward to enumerate the resources  in a file. But it turned out to be rather a lot of work (and waste of time), since the MS doesn&#8217;t tell you, that it doesn&#8217;t enumerate the strings, but blocks of strings in a binary format that you have to process yourself.</p>
<p>Here&#8217;s how to do it:</p>
<pre>BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam)
{
 switch ((int)lpszType)
 {
 case RT_STRING:
 {
 HRSRC hRes = FindResourceEx(hModule, RT_STRING, MAKEINTRESOURCE(lpszName), MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));

 if (hRes)
 {
 HGLOBAL hGlo = LoadResource(hModule, hRes);
 LPCWSTR lpStr = (LPCWSTR)LockResource(hGlo);
 DWORD dwsize = SizeofResource(hModule, hRes);

 long count=0;
 for (int i=0; i &lt; (int)dwsize; i++)
 {
 count++;
 if (count&gt;=16)
 break;

 if (lpStr[i])
 {
 WORD *pString = lpStr+i+1;
 long lString = lpStr[i];

 //Process string here

 i += lpStr[i];
 }
 }
 }
 }
 break;
 }

 return(TRUE);
}

EnumResourceNames(hModule, RT_STRING, &amp;EnumResNameProc, NULL);</pre>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2012/05/04/enumresourcenames-rt_string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
