<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tech Leaves</title>
	<atom:link href="http://techleaves.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techleaves.wordpress.com</link>
	<description>Leaves from my knowledge base...</description>
	<lastBuildDate>Mon, 02 Jan 2012 10:18:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='techleaves.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tech Leaves</title>
		<link>http://techleaves.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://techleaves.wordpress.com/osd.xml" title="Tech Leaves" />
	<atom:link rel='hub' href='http://techleaves.wordpress.com/?pushpress=hub'/>
		<item>
		<title>2011 in review</title>
		<link>http://techleaves.wordpress.com/2012/01/02/2011-in-review/</link>
		<comments>http://techleaves.wordpress.com/2012/01/02/2011-in-review/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 10:18:01 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=439</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: A San Francisco cable car holds 60 people. This blog was viewed about 2,300 times in 2011. If it were a cable car, it would take about 38 trips to carry that many people. Click here to see the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=439&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p>	<a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" width="100%" alt="" /></a></p>
<p>Here&#8217;s an excerpt:</p>
</p>
<blockquote><p>A San Francisco cable car holds 60 people.  This blog was viewed about <strong>2,300</strong> times in 2011.  If it were a cable car, it would take about 38 trips to carry that many people.</p>
</blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/439/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=439&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2012/01/02/2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>Displaying XP Style CFileDialog in Windows 7</title>
		<link>http://techleaves.wordpress.com/2011/07/29/displaying-xp-style-cfiledialog-in-windows-7/</link>
		<comments>http://techleaves.wordpress.com/2011/07/29/displaying-xp-style-cfiledialog-in-windows-7/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 09:26:34 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[CFileDialog]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[Places bar]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[XP Style]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=425</guid>
		<description><![CDATA[CFileDialog is an MFC class that gives interface to the &#8220;browse&#8221; windows for opening and saving a file or files. In Windows 7 you can see that there are significant differences in the appearance of the same compared to Windows XP. It is since the Windows Vista this change happened. Nice and neat of-course. I&#8217;m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=425&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="justify">CFileDialog is an MFC class that gives interface to the &#8220;browse&#8221; windows for opening and saving a file or files. In Windows 7 you can see that there are significant differences in the appearance of the same compared to Windows XP. It is since the Windows Vista this change happened. Nice and neat of-course.</p>
<p><div class="wp-caption aligncenter" style="width: 445px"><img alt="" src="http://i.stack.imgur.com/5E72N.png" title="Vista Style CFileDialog" width="435" height="272" /><p class="wp-caption-text">Default CFileDialog in Windows 7</p></div><br />
<div class="wp-caption aligncenter" style="width: 806px"><img alt="" src="http://i.stack.imgur.com/DqEoE.png" title="XP Style CFileDialog" width="80%" /><p class="wp-caption-text">CFileDialog as in Windows XP</p></div></p>
<p align="justify">I&#8217;m perfectly OK with the <code>CFileDialog </code>as in Win7, but my client wasn&#8217;t. I asked many of my gurus and couldn&#8217;t find a way out, but the very simple solution for this, I got as an answer to <a href="http://stackoverflow.com/questions/6856141/display-xp-style-cfiledialog-in-windows-7" title="Stack Overflow to the Rescue" target="_blank">my stack overflow question</a>. In the CFileDialog constructor, the last parameter, bVistaStyle will be <code>TRUE </code>by default. We will have to make it <code>FALSE </code>and you will get an Open/Save Dialog just like the first image. You can also remove the places bar and make it simple by setting <code>OFN_EX_NOPLACESBAR</code> to <code>m_ofn.FlagsEx</code> before <code>DoModal</code>-ing the dialog.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/425/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=425&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2011/07/29/displaying-xp-style-cfiledialog-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://i.stack.imgur.com/5E72N.png" medium="image">
			<media:title type="html">Vista Style CFileDialog</media:title>
		</media:content>

		<media:content url="http://i.stack.imgur.com/DqEoE.png" medium="image">
			<media:title type="html">XP Style CFileDialog</media:title>
		</media:content>
	</item>
		<item>
		<title>CWnd::ShowWindow Can&#8217;t always Hide your Window!</title>
		<link>http://techleaves.wordpress.com/2011/07/18/cwndshowwindow-cant-always-hide-your-window/</link>
		<comments>http://techleaves.wordpress.com/2011/07/18/cwndshowwindow-cant-always-hide-your-window/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 11:03:23 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Findings]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Hide Window]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[Multithreaded]]></category>
		<category><![CDATA[ShowWindow]]></category>
		<category><![CDATA[ShowWindowAsync]]></category>
		<category><![CDATA[Win32]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=419</guid>
		<description><![CDATA[CWnd::ShowWindow as most think is perhaps the most used member function in CWnd the basic MFC window class. Sticking heavily to MFC has its disadvantages. Before coming to that, let me say this. SW_SHOW and SW_HIDE aren&#8217;t the only values that can be passed to the function. SW_HIDE: Hides this window and passes activation to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=419&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="justify"> CWnd::ShowWindow as most think is perhaps the most used member function in CWnd the basic MFC window class. Sticking heavily to MFC has its disadvantages. Before coming to that, let me say this. SW_SHOW and SW_HIDE aren&#8217;t the only values that can be passed to the function.</p>
<ul>
<li><strong>SW_HIDE</strong>: Hides this window and passes activation to another window.</li>
<li><strong>SW_MINIMIZE</strong>: Minimizes the window and activates the top-level window in the system&#8217;s list.</li>
<li><strong>SW_RESTORE</strong>: Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position.</li>
<li><strong>SW_SHOW</strong>: Activates the window and displays it in its current size and position.</li>
<li><strong>SW_SHOWMAXIMIZED</strong>: Activates the window and displays it as a maximized window.</li>
<li><strong>SW_SHOWMINIMIZED</strong>: Activates the window and displays it as an icon.</li>
<li><strong>SW_SHOWMINNOACTIVE</strong>: Displays the window as an icon. The window that is currently active remains active.</li>
<li><strong>SW_SHOWNA</strong>: Displays the window in its current state. The window that is currently active remains active.</li>
<li><strong>SW_SHOWNOACTIVATE</strong>: Displays the window in its most recent size and position. The window that is currently active remains active.</li>
<li><strong>SW_SHOWNORMAL</strong>: Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position.</li>
</ul>
<p align="justify">Here, window activation, whether you need it or not is an important thought. Now here is the point. You can&#8217;t do any of these to a window created in a different thread. CWnd doesn&#8217;t have a function for this purpose. Its object oriented policies doesn&#8217;t allow it to have one I guess. A win32 API is here to save the day; <strong>ShowWindowAsync</strong>. This API can set the visibility state of a window created in another thread. So, if you are in a multi-threaded application be sure to use this API to hide or show your window in case of creation of the same from different threads.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/419/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/419/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/419/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=419&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2011/07/18/cwndshowwindow-cant-always-hide-your-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>
	</item>
		<item>
		<title>Count Specific Characters in CString</title>
		<link>http://techleaves.wordpress.com/2011/07/12/count-specific-characters-cstring/</link>
		<comments>http://techleaves.wordpress.com/2011/07/12/count-specific-characters-cstring/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 14:30:47 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Character count]]></category>
		<category><![CDATA[CString]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[Remove]]></category>
		<category><![CDATA[Replace]]></category>
		<category><![CDATA[SpanExcluding]]></category>
		<category><![CDATA[SpanIncluding]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=399</guid>
		<description><![CDATA[First of all, CString doesn&#8217;t have a direct member function for this. But at times we will need this functionality and it is not that particular not to add it as a member if they can add functions like SpanIncluding, Replace etc. So lets discuss some ways which I found that can get the job [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=399&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="justify">First of all, CString doesn&#8217;t have a direct member function for this. But at times we will need this functionality and it is not that particular not to add it as a member if they can add functions like SpanIncluding, Replace etc. So lets discuss some ways which I found that can get the job done.</p>
<h3>SpanIncluding/SpanExcluding</h3>
<p align="justify"><strong>NO!!!</strong> This is not even a way to do it. One can think that what if we use SpanExcluding using the character we want as a delimiter and subtract the length of resultant string from the length of original string. Similar  is the case for SpanIncluding. Now, listen to this! These functions will not return all the characters other than the delimiters. Its somewhat continuous. For example, calling SpanExluding for string &#8220;abc:cd&#8221; with delimiter &#8220;:&#8221; will return string &#8220;abc&#8221; only. Same is the case with SpanIncluding.</p>
<h3>Remove/Replace</h3>
<p align="justify">This is the most easiest way in terms of lines of code. Both function returns the count of the character that is replaced or removed. Take care to make a copy of the string before doing this. It involves editing of the string; especially the Remove function requires shifting of characters after the removed character. So this method is not suitable for large strings as it can cause performance hit.</p>
<h3>Find<small> (recommended)</small></h3>
<p align="justify">I searched a lot for a function that works like magic in a single line of code. The conclusion as I could find was, There is no highway option! The best thing you can do is to use Find function in a while loop to find each character. Is that complex? here&#8217;s the code:</p>
<p><code>
<pre>int CharacterCount( CString&amp; csString_i, LPCTSTR sChar_i )
{
	if( csString_i.IsEmpty() || L"" == sChar_i )
	{
		return 0;
	}
	int nFind = -1;
	int nCount = 0;
	while( -1 != ( nFind = csString_i.Find( sChar_i, nFind + 1 )))
	{
		nCount++;
	}
	return nCount;
}</pre>
<p></code></p>
<p align="justify">Got a better way? Please give your thoughts as comments.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/399/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/399/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/399/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=399&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2011/07/12/count-specific-characters-cstring/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Retain Control Size after Dialog Font Change &#8211; MFC</title>
		<link>http://techleaves.wordpress.com/2011/05/29/how-to-retain-control-size-after-dialog-font-change-mfc/</link>
		<comments>http://techleaves.wordpress.com/2011/05/29/how-to-retain-control-size-after-dialog-font-change-mfc/#comments</comments>
		<pubDate>Sun, 29 May 2011 19:25:35 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Findings]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[co-ordinates]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[dialog unit]]></category>
		<category><![CDATA[font size]]></category>
		<category><![CDATA[resource file]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=386</guid>
		<description><![CDATA[Scenario Suppose you have designed a dialog that are having a lot of controls, and you made it look perfect. Now your client says: &#8220;Oh, The font looks a bit small. Can you enlarge it a bit and keep up the same look and feel?&#8221;. So, what&#8217;s the big deal lets change the font size. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=386&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Scenario</h3>
<p style="text-align:justify;">Suppose you have designed a dialog that are having a lot of controls, and you made it look perfect. Now your client says: &#8220;Oh, The font looks a bit small. Can you enlarge it a bit and keep up the same look and feel?&#8221;. So, what&#8217;s the big deal lets change the font size. OK, Changed? So what do you see? The size of the dialog including all the controls in it has changed according to the font size and everything got bigger. Now maintaining the same font size, you will need to resize and re-position all the controls in it one by one, which is really a hard thing.</p>
<h3>Reason</h3>
<p style="text-align:justify;">Well, whats the reason behind this? Your resource file (.rc) uses something called dialog units to specify the position and size of the controls. This thing is completely dependent on the font size you set to the dialog, and that is the reason for the size of each control in the dialog even though there is no text in the same. ( refer the msdn doc: <a title="Dialog Units" href="http://support.microsoft.com/kb/145994" target="_blank">http://support.microsoft.com/kb/145994</a>  to get a better understanding about dialog units)</p>
<h3>Solution</h3>
<p style="text-align:justify;">One solution is to do all things dynamically, that is using SetWindowPos function to set the correct position and sizes in pixels. But that too is hard as if you already designed it. So I decided to create an application that parse your resource code block, identify the control co-ordinates and convert them in such a way that there will not be a size change according to the font size. All you have to do is:</p>
<p><img class="aligncenter size-full wp-image-388" title="copy_code" src="http://techleaves.files.wordpress.com/2011/05/copy_code.png?w=604" alt=""   /></p>
<ol>
<li style="text-align:justify;">Run the application</li>
<li style="text-align:justify;">Input the previous font name and font size, the new font size and font name</li>
<li style="text-align:justify;">Open the resource file that has the code of the dialog</li>
<li style="text-align:justify;">Copy the code starting from the line below &#8220;BEGIN&#8221; statement up to the previous line of &#8220;END&#8221; statement</li>
<li style="text-align:justify;">Click &#8220;Convert&#8221; button, and you can see the co-ordinate adjusted code on the edit window on right side.</li>
<li style="text-align:justify;">Replace it to the resource file after comparing the original version (ideally using beyond compare).</li>
</ol>
<p><img class="aligncenter size-full wp-image-389" title="DlgFontAdjuster" src="http://techleaves.files.wordpress.com/2011/05/dlgfontadjuster.png?w=604&#038;h=359" alt="" width="604" height="359" /></p>
<h3>Logic</h3>
<p style="text-align:justify;">Very simple. The application looks for and reads the first 4 comma separated integers in each line, which will obviously be the x,y, width and height values of a control. When it gets such a group of values, it will generate the values using the formula in the aforementioned doc. That means, you can also give the desired values in the format: &#8220;x,y,width,height&#8221; (not &#8220;left,top,right,bottom&#8221;) to get the converted value, which you will have to do in order to convert co-ordinates of the dialog which in code isn&#8217;t properly comma separated.</p>
<p>Note: If the text in new font does not fit in the previous control size, you will need to manually adjust the size of such controls in order for the text to fit in.</p>
<p><strong>Download: <a title="DlgFontAdjuster" href="http://www.box.net/shared/t3mjfqz58o" target="_blank">DlgUnitFontAdjuster.zip</a></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/386/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=386&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2011/05/29/how-to-retain-control-size-after-dialog-font-change-mfc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2011/05/copy_code.png" medium="image">
			<media:title type="html">copy_code</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2011/05/dlgfontadjuster.png" medium="image">
			<media:title type="html">DlgFontAdjuster</media:title>
		</media:content>
	</item>
		<item>
		<title>Yanking the Kill Ring: Emacs</title>
		<link>http://techleaves.wordpress.com/2011/01/31/yanking-the-kill-ring-emacs/</link>
		<comments>http://techleaves.wordpress.com/2011/01/31/yanking-the-kill-ring-emacs/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 13:35:53 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[shortcuts]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">https://techleaves.wordpress.com/2011/01/31/yanking-the-kill-ring-emacs/</guid>
		<description><![CDATA[The title of the post might confuse the normal windows users, like me of-course. There was a situation where I&#8217;m forced to use Ububtu, a Linux based operating system, and that too in kernel mode only. The scenario is my engineering college where they do this in programming labs in-order to avoid students copying other&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=378&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">The title of the post might confuse the normal windows users, like me of-course. There was a situation where I&#8217;m forced to use Ububtu, a Linux based operating system, and that too in kernel mode only. The scenario is my engineering college where they do this in programming labs in-order to avoid students copying other&#8217;s programs by giving them a login name each and restricting GUI mode.</p>
<p style="text-align:justify;"><a href="http://techleaves.files.wordpress.com/2011/01/emacs.png"><img class="alignleft size-full wp-image-380" title="emacs" src="http://techleaves.files.wordpress.com/2011/01/emacs.png?w=604" alt=""   /></a>The only editors available is nano, emacs and vi editor. Emacs was my choice as I simply didn&#8217;t like nano and wasn&#8217;t ready to use simple but powerful vi since it requires memorizing lot of editor commands. As I&#8217;m not only a student, but also a software engineer by profession, The transition from an intellisense enabled Visual Studio 2010 to the very basic emacs editor wasn&#8217;t cool.</p>
<p style="text-align:justify;">Emacs was more horrible than a notepad editor since don&#8217;t know how to do the basic things a software engineer must know: Copy, Paste and Undo. Undo was a nightmare since the shortcut key Ctrl + z in windows will result in the termination of emacs.</p>
<p style="text-align:justify;">Emacs editor have a menubar and you can access it using the key F10. It can be easily navigated and the shortcut for the command can be got from there. Anyway let me list some of the commands below.</p>
<ol>
<li>Cut / Kill line: Ctrl + K</li>
<li>Copy / Add to kill ring: ALT + W</li>
<li>Paste / Yank: Ctrl + Y</li>
<li>Mark text: Ctrl + @</li>
<li>Undo: Ctrl + _</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/378/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=378&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2011/01/31/yanking-the-kill-ring-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2011/01/emacs.png" medium="image">
			<media:title type="html">emacs</media:title>
		</media:content>
	</item>
		<item>
		<title>How to stop Windows 7 Blacking out the Desktop</title>
		<link>http://techleaves.wordpress.com/2011/01/14/how-to-stop-windows-7-blacking-out-the-desktop/</link>
		<comments>http://techleaves.wordpress.com/2011/01/14/how-to-stop-windows-7-blacking-out-the-desktop/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 10:04:35 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Findings]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[blackout]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[dim]]></category>
		<category><![CDATA[UAC]]></category>
		<category><![CDATA[user account settings]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=373</guid>
		<description><![CDATA[This happens most of the times. When we try to install an application, the screen gets dimmed and a message box appears asking whether it should give permission for that application to run or modify the system. The dialog is fine and really a good thing as it gives us more control over the applications [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=373&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">This happens most of the times. When we try to install an application, the screen gets dimmed and a message box appears asking whether it should give permission for that application to run or modify the system. The dialog is fine and really a good thing as it gives us more control over the applications running. But the one thing that freaks me out is that blacking out or dimming of desktop before asking this. It is very slow in my laptop. A java update is on my start-up and this shows up every time I start the system causing the same blackout. In some machines like the one in my office, the monitor turns off and on in this process.</p>
<p style="text-align:justify;"><img class="aligncenter size-full wp-image-374" title="UAC" src="http://techleaves.files.wordpress.com/2011/01/uac.png?w=604" alt=""   /></p>
<p style="text-align:justify;">The solution is very simple. Go to Control Panel\System and Security and click &#8220;User Account Control Settings&#8221;. It will pop-up a dialog asking something like a security level. The default will be &#8220;Notify me only when the programs try to make changes to the computer&#8221;. Select the level below, which is &#8220;Notify me only when the programs try to make changes to the computer (do not dim my desktop)&#8221;. Even though Windows never recommends it, you can use it when its taking long time in default mode. The applications will ask for your permission, but it will no longer dim your desktop.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=373&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2011/01/14/how-to-stop-windows-7-blacking-out-the-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2011/01/uac.png" medium="image">
			<media:title type="html">UAC</media:title>
		</media:content>
	</item>
		<item>
		<title>Linking resources from a static library</title>
		<link>http://techleaves.wordpress.com/2011/01/12/linking-resources-from-a-static-library/</link>
		<comments>http://techleaves.wordpress.com/2011/01/12/linking-resources-from-a-static-library/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 04:13:15 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[CVTRES]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[fatal error]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[linker]]></category>
		<category><![CDATA[RES]]></category>
		<category><![CDATA[resource conflict]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[VS 2008]]></category>

		<guid isPermaLink="false">https://techleaves.wordpress.com/2011/01/12/linking-resources-from-a-static-library/</guid>
		<description><![CDATA[I came across a situation where we have a static library that need to be loaded to an exe. Both have their own resources. Here, the problem is when the exe loads the library, it will not load it&#8217;s resources. It will only have it&#8217;s own resources and when the application tries to access the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=369&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I came across a situation where we have a static library that need to be loaded to an exe. Both have their own resources. Here, the problem is when the exe loads the library, it will not load it&#8217;s resources. It will only have it&#8217;s own resources and when the application tries to access the resource even from within the library, it will cause an exception.</p>
<p style="text-align:justify;">A common solution for this problem is using a dll instead of the static library and loading it&#8217;s resources dynamically. But what if we have restrictions on number of binaries to be shipped? In my case the client wanted to ship it as a single exe, so he declined the option of using a dll. Another solution was to add the resource file( RC file ) of the library to the project of the executable. But that too is not a good practice since adding resource to the exe is like exposing the source of the library file. Also it may cause resource conflict. So one may need to rearrange the resource.h files.</p>
<p style="text-align:justify;"><img class="aligncenter size-full wp-image-371" title="Static library RES linking" src="http://techleaves.files.wordpress.com/2011/01/res-link.png?w=604" alt=""   /></p>
<p style="text-align:justify;">A solution that possibly worked for me was an<a title="VC++ resources in a static library " href="http://stackoverflow.com/questions/531502/vc-resources-in-a-static-library/1631078#1631078" target="_blank"> unchosen answer</a> came on stack overflow. It suggested, linking the compiled resource file( RES file ) of the static library along with the same. You can do that by mentioning the relative path of the res file in the linker input of the executable. You can adjust the path in which the res file is to be built to make things clean. If you check, you can see that the res file is a binary file. So, no worry on exposing the source. When I tried the same, I it really worked! If there is a resource conflict where two dialogs IDs have same value, the linker ( VS 2008 ) will generate an error like this:</p>
<blockquote>
<p style="text-align:justify;">1&gt;CVTRES : fatal error CVT1100: duplicate resource.  type:DIALOG, name:101, language:0&#215;0409<br />
1&gt;LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt</p>
</blockquote>
<p style="text-align:justify;">So there will no longer be an exception at run-time. I don&#8217;t know whether this is a good way or not, but it saved my day!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/369/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=369&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2011/01/12/linking-resources-from-a-static-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2011/01/res-link.png" medium="image">
			<media:title type="html">Static library RES linking</media:title>
		</media:content>
	</item>
		<item>
		<title>Be careful with DECLARE_MESSAGE_MAP()</title>
		<link>http://techleaves.wordpress.com/2010/12/02/be-careful-with-declare_message_map/</link>
		<comments>http://techleaves.wordpress.com/2010/12/02/be-careful-with-declare_message_map/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 08:31:29 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Findings]]></category>
		<category><![CDATA[Issues]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[DECLARE_MESSAGE_MAP]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[protected]]></category>
		<category><![CDATA[storage class]]></category>
		<category><![CDATA[VC++]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=363</guid>
		<description><![CDATA[If you decide to clean up and re- arrange your code, better be careful about the DECLARE_MESSAGE_MAP() macro that will be present in an MFC derived class header file. This macro contains a &#8220;protected&#8221; storage class declaration. So everything that comes under this macro will be protected unless there is any other storage class specified after [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=363&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">If you decide to clean up and re- arrange your code, better be careful about the DECLARE_MESSAGE_MAP() macro that will be present in an MFC derived class header file. This macro contains a &#8220;protected&#8221; storage class declaration. So everything that comes under this macro will be protected unless there is any other storage class specified after that. Normal error that occur during compilation will be cannot access the private variable. But you cannot easily figure out what went wrong you can see only a macro call and a public storage class above.</p>
<p style="text-align:justify;"><img class="aligncenter size-full wp-image-364" title="declare_msg_map" src="http://techleaves.files.wordpress.com/2010/12/declare_msg_map.png?w=604" alt=""   /></p>
<p style="text-align:justify;">The solution is to leave it inside a protected storage class. i.e, declare a protected storage class just above it and declare the functions and variables that require to be protected, below it. Let the public functions and variables be above the protected section with proper declaration of the storage class.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/363/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/363/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/363/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=363&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2010/12/02/be-careful-with-declare_message_map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2010/12/declare_msg_map.png" medium="image">
			<media:title type="html">declare_msg_map</media:title>
		</media:content>
	</item>
		<item>
		<title>VS 2010: Deriving an MFC Class</title>
		<link>http://techleaves.wordpress.com/2010/11/05/deriving-an-mfc-class-vs-2010/</link>
		<comments>http://techleaves.wordpress.com/2010/11/05/deriving-an-mfc-class-vs-2010/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 05:37:42 +0000</pubDate>
		<dc:creator>The Half-Blood Geek</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Findings]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[VS 2010]]></category>

		<guid isPermaLink="false">http://techleaves.wordpress.com/?p=352</guid>
		<description><![CDATA[Here is a quick tip, beginner series of course! If you want to derive from an MFC class like CButton, What you normally do at first will be take the resource view, right click and select &#8220;Add Class&#8221; from the menu. You will end up with the class wizard asking for you to select the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=352&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Here is a quick tip, beginner series of course! If you want to derive from an MFC class like CButton, What you normally do at first will be take the resource view, right click and select &#8220;Add Class&#8221; from the menu. You will end up with the class wizard asking for you to select the base class from a limited set of Classes like CDialog, CDialogEx, CPropertySheet. You will wonder where did the other classes go. But its not actually the method.</p>
<p><a href="http://techleaves.files.wordpress.com/2010/11/clw1.png"><img class="aligncenter size-full wp-image-353" title="clw1" src="http://techleaves.files.wordpress.com/2010/11/clw1.png?w=604" alt=""   /></a></p>
<p style="text-align:justify;"><a href="http://techleaves.files.wordpress.com/2010/11/clw2.png"><img class="aligncenter size-full wp-image-354" title="clw2" src="http://techleaves.files.wordpress.com/2010/11/clw2.png?w=604" alt=""   /></a></p>
<p>You may take the &#8220;Class wizard&#8221; from the menu mentioned and then select &#8220;New Class&#8221; button to take the option &#8220;MFC Class&#8221; and now you can see all those classes you need.</p>
<p><a href="http://techleaves.files.wordpress.com/2010/11/clw3.png"><img class="aligncenter size-full wp-image-355" title="clw3" src="http://techleaves.files.wordpress.com/2010/11/clw3.png?w=604" alt=""   /></a><a href="http://techleaves.files.wordpress.com/2010/11/clw4.png"><img class="aligncenter size-full wp-image-356" title="clw4" src="http://techleaves.files.wordpress.com/2010/11/clw4.png?w=604" alt=""   /></a><a href="http://techleaves.files.wordpress.com/2010/11/clw5.png"><img class="aligncenter size-full wp-image-357" title="clw5" src="http://techleaves.files.wordpress.com/2010/11/clw5.png?w=604" alt=""   /></a></p>
<p style="text-align:justify;">I know its nothing, but I just wasted some time searching for it. Sometimes the smaller things get trickier!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techleaves.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techleaves.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techleaves.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techleaves.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techleaves.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techleaves.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techleaves.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techleaves.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techleaves.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techleaves.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techleaves.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techleaves.wordpress.com/352/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techleaves.wordpress.com/352/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techleaves.wordpress.com/352/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techleaves.wordpress.com&amp;blog=11046924&amp;post=352&amp;subd=techleaves&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techleaves.wordpress.com/2010/11/05/deriving-an-mfc-class-vs-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>8.568642 76.874979</georss:point>
		<geo:lat>8.568642</geo:lat>
		<geo:long>76.874979</geo:long>
		<media:content url="http://0.gravatar.com/avatar/0dbf91f1acdae4eb97f22b303eb71104?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rageshctech</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2010/11/clw1.png" medium="image">
			<media:title type="html">clw1</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2010/11/clw2.png" medium="image">
			<media:title type="html">clw2</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2010/11/clw3.png" medium="image">
			<media:title type="html">clw3</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2010/11/clw4.png" medium="image">
			<media:title type="html">clw4</media:title>
		</media:content>

		<media:content url="http://techleaves.files.wordpress.com/2010/11/clw5.png" medium="image">
			<media:title type="html">clw5</media:title>
		</media:content>
	</item>
	</channel>
</rss>
