<?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_ &#187; AfxWinMain</title>
	<atom:link href="http://devblog.itsth.com/tag/afxwinmain/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.itsth.com</link>
	<description>Thoughts on developing shareware</description>
	<lastBuildDate>Wed, 14 Dec 2011 16:29:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Weird problem with AfxWinMain()</title>
		<link>http://devblog.itsth.com/2010/01/27/weird-problem-with-afxwinmain/</link>
		<comments>http://devblog.itsth.com/2010/01/27/weird-problem-with-afxwinmain/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 13:01:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[AfxGetThread]]></category>
		<category><![CDATA[AfxWinMain]]></category>
		<category><![CDATA[NULL]]></category>

		<guid isPermaLink="false">http://devblog.itsth.com/?p=75</guid>
		<description><![CDATA[I spent the last hours hunting down a weird crash problem in AfxWinMain(). It&#8217;s the init function in an MFC application that gets called before anything else. And it crashes at &#8220;if (!pThread-&#62;InitInstance())&#8221; because AfxGetThread() returned a NULL pointer. The problem was paired with link errors that vanished when the buid was repeated. Since this is [...]]]></description>
			<content:encoded><![CDATA[<p>I spent the last hours hunting down a weird crash problem in AfxWinMain(). It&#8217;s the init function in an MFC application that gets called before anything else.</p>
<p>And it crashes at &#8220;<strong>if (!pThread-&gt;InitInstance())</strong>&#8221; because AfxGetThread() returned a NULL pointer.</p>
<p>The problem was paired with link errors that vanished when the buid was repeated. Since this is &#8220;normal&#8221; with MS C++ (I&#8217;ve seen that problem often before), I didn&#8217;t really notice it.</p>
<p>As it turns out the entire code was correct. I imported it into a new project and it worked. Comparing the the vcproj-Files I found the line that made all the difference. Removing this line suddenly fixed my problem:</p>
<p>&#8220;ObjectFile=&#8221;.\DebugD64&#8243;</p>
<p>(in Configuration &gt; Tool Name=&#8221;VCCLCompilerTool&#8221;).</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.itsth.com/2010/01/27/weird-problem-with-afxwinmain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

