<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:media="http://search.yahoo.com/mrss/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>bits and bytes</title>
	
	<link>http://nibuthomas.com</link>
	<description>Jesus Loves You. C, C++, VC++, .net code snippets and articles, based on Nibu's day to day programming experiences.</description>
	<lastBuildDate>Mon, 21 Sep 2009 13:33:39 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain="nibuthomas.com" port="80" path="/?rsscloud=notify" registerProcedure="" protocol="http-post" />
<image><link>http://creativecommons.org/licenses/by-sa/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image>
			<creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/wordpress/svRz" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Some issues when working with ComboBox</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/ahMq0ChumFE/</link>
		<comments>http://nibuthomas.com/2009/08/11/some-issues-when-working-with-combobox/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 14:32:40 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[MFC]]></category>
		<category><![CDATA[Windows API]]></category>
		<category><![CDATA[CComboBox]]></category>
		<category><![CDATA[CComboBox issues]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1970</guid>
		<description><![CDATA[The main reason for posting this issue is to help MFC/Win32 beginners. But anyway it&#8217;s a good read  , so once upon a time&#8230;
If you&#8217;re a beginner with window&#8217;s ComboBox controls then you might end up with a bald head thinking and thinking about a weird behavior of combo&#8217;s after it&#8217;s creation. The combo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1970&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The main reason for posting this issue is to help MFC/Win32 beginners. But anyway it&#8217;s a good read <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , so once upon a time&#8230;</p>
<p>If you&#8217;re a beginner with window&#8217;s ComboBox controls then you might end up with a bald head thinking and thinking about a weird behavior of combo&#8217;s after it&#8217;s creation. The combo as such is a great control but there are certain important things to keep in mind while creating a combo.</p>
<p>So what are the problems? Well make it singular, &#8220;Problem&#8221;. One and the only problem with this control is shown in this screenshot&#8230;</p>
<div id="attachment_1971" class="wp-caption aligncenter" style="width: 330px"><a rel="attachment wp-att-1971" href="http://nibuthomas.com/2009/08/11/some-issues-when-working-with-combobox/combobug/"><img class="size-full wp-image-1971" title="ComboBug" src="http://nibuthomas.files.wordpress.com/2009/08/combobug.png?w=320&#038;h=154" alt="Drop down not visible" width="320" height="154" /></a><p class="wp-caption-text">Drop down not visible</p></div>
<p>I&#8217;ve clicked the drop down arrow but cannot see the dropdown. This one is created via resource editor. The problem here is, just adding a combo is not enough but we&#8217;ve also got to set the size of the drop down via resource editor. So follow these steps, as shown in the screen shot to fix this issue&#8230;</p>
<div id="attachment_1972" class="wp-caption aligncenter" style="width: 337px"><a rel="attachment wp-att-1972" href="http://nibuthomas.com/2009/08/11/some-issues-when-working-with-combobox/solution/"><img class="size-full wp-image-1972" title="Solution" src="http://nibuthomas.files.wordpress.com/2009/08/solution.png?w=327&#038;h=223" alt="Resizing a combo drop down" width="327" height="223" /></a><p class="wp-caption-text">Resizing a combo drop down</p></div>
<p>So that&#8217;s it. The white drag rectangle denotes combo drop down size. Press Ctrl + T to test this. Please note that this is not a bug but a feature of resource editor since there isn&#8217;t an another way to set drop down size for a combo via resource editor. But I agree that they should&#8217;ve set a better default drop down size instead of a zero height drop down.</p>
<p>Now this was via resource editor. It&#8217;s bit different when creating dynamically via code using CComboBox::Create function. Note that you have to give a valid height value. This height value will be the dropdown size for this combo.</p>
<p>See this e.g.</p>
<pre class="brush: cpp;">m_Combo.Create( WS_VISIBLE | WS_TABSTOP | WS_BORDER | CBS_DROPDOWNLIST | CBS_SORT,
                CRect( 10, 10, 200, 300 ),
                this,
                IDC_COMBO1 + 1 );
m_Combo.SetFont( GetFont(), TRUE );</pre>
<p>Hope you&#8217;ve noticed the last big value given to Combo via CRect, 300. That&#8217;s the drop down height. Normally beginners set it to 30 or 40 which results in this issue.</p>
<p>See the resultant screenshot&#8230;</p>
<div id="attachment_1983" class="wp-caption aligncenter" style="width: 739px"><a rel="attachment wp-att-1983" href="http://nibuthomas.com/2009/08/11/some-issues-when-working-with-combobox/combodemo/"><img class="size-full wp-image-1983" title="ComboDemo" src="http://nibuthomas.files.wordpress.com/2009/08/combodemo.png?w=729&#038;h=221" alt="Result of properly creating a combo" width="729" height="221" /></a><p class="wp-caption-text">Result of properly creating a combo</p></div>
<p>Not a big deal for experts but for beginners, well I&#8217;ve been a beginner too, it&#8217;s one painful issue. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
Posted in MFC, Windows API Tagged: CComboBox, CComboBox issues <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1970/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1970/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1970/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1970&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/ahMq0ChumFE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/08/11/some-issues-when-working-with-combobox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>

		<media:content url="http://nibuthomas.files.wordpress.com/2009/08/combobug.png" medium="image">
			<media:title type="html">ComboBug</media:title>
		</media:content>

		<media:content url="http://nibuthomas.files.wordpress.com/2009/08/solution.png" medium="image">
			<media:title type="html">Solution</media:title>
		</media:content>

		<media:content url="http://nibuthomas.files.wordpress.com/2009/08/combodemo.png" medium="image">
			<media:title type="html">ComboDemo</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/08/11/some-issues-when-working-with-combobox/</feedburner:origLink></item>
		<item>
		<title>How to use SendInput?</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/08xmDL45U1I/</link>
		<comments>http://nibuthomas.com/2009/08/04/how-to-use-sendinput/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 11:43:01 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[Windows API]]></category>
		<category><![CDATA[SendInput]]></category>
		<category><![CDATA[Simulate keyboard]]></category>
		<category><![CDATA[Simulate mouse]]></category>
		<category><![CDATA[Using SendInput]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1963</guid>
		<description><![CDATA[So what does SendInput API do?
SendInput API is a helper function to simulate keyboard and mouse inputs. It&#8217;s an ideal function to insert characters into a password which otherwise is not possible. Here is what MSDN says about this function&#8230;
&#8220;The SendInput function inserts the events in the INPUT structures serially into the keyboard or mouse [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1963&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So what does SendInput API do?</p>
<p><em>SendInput</em> API is a helper function to simulate keyboard and mouse inputs. It&#8217;s an ideal function to insert characters into a password which otherwise is not possible. Here is what MSDN says about this function&#8230;</p>
<p>&#8220;The <strong>SendInput</strong> function inserts the events in the <strong>INPUT</strong> structures serially into the keyboard or mouse input stream. These events are not interspersed with other keyboard or mouse input events inserted either by the user (with the keyboard or mouse) or by calls to <a id="ctl00_MTContentSelector1_mainContentContainer_ctl04" href="http://msdn.microsoft.com/en-us/library/ms646304%28VS.85%29.aspx">keybd_event</a>, <a id="ctl00_MTContentSelector1_mainContentContainer_ctl05" href="http://msdn.microsoft.com/en-us/library/ms646260%28VS.85%29.aspx">mouse_event</a>, or other calls to <strong>SendInput</strong>.&#8221;</p>
<p>Here is a simple and basic function which sends a given text to a foreground window (my earlier function was crap so I replaced it with this new one that works for all texts, haven&#8217;t tried out with foreign keyboards though)&#8230;</p>
<pre class="brush: cpp;">BOOL SendText( LPCSTR lpctszText )
{
   vector&lt; INPUT &gt; EventQueue;

   char Buff[120] = {0};
   GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILANGUAGE, Buff, sizeof(Buff));
   HKL hKeyboardLayout = ::LoadKeyboardLayout( Buff, KLF_ACTIVATE );

   const int Len = strlen( lpctszText );
   for( int Index = 0; Index &amp;amp;amp;amp;lt; Len; ++Index )
   {
      INPUT Event = { 0 };

      const SHORT Vk = VkKeyScanEx(lpctszText[Index], hKeyboardLayout);
      const UINT VKey = ::MapVirtualKey( LOBYTE( Vk ), 0 );

      if( HIBYTE( Vk ) == 1 ) // Check if shift key needs to be pressed for this key
      {
          // Press shift key
          ::ZeroMemory( &amp;amp;amp;amp;amp;Event, sizeof( Event ));
          Event.type = INPUT_KEYBOARD;
          Event.ki.dwFlags = KEYEVENTF_SCANCODE;
          Event.ki.wScan = ::MapVirtualKey( VK_LSHIFT, 0 );
          EventQueue.push_back( Event );
      }

      // Keydown
      ::ZeroMemory( &amp;amp;amp;amp;amp;Event, sizeof( Event ));
      Event.type = INPUT_KEYBOARD;
      Event.ki.dwFlags = KEYEVENTF_SCANCODE;
      Event.ki.wScan = VKey;
      EventQueue.push_back( Event );

      // Keyup
      ::ZeroMemory( &amp;amp;amp;amp;amp;Event, sizeof( Event ));
      Event.type = INPUT_KEYBOARD;
      Event.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
      Event.ki.wScan = VKey;
      EventQueue.push_back( Event );

      if( HIBYTE( Vk ) == 1 )// Release if previouly pressed
      {
           // Release shift key
          ::ZeroMemory( &amp;amp;amp;amp;amp;Event, sizeof( Event ));
          Event.type = INPUT_KEYBOARD;
          Event.ki.dwFlags = KEYEVENTF_SCANCODE| KEYEVENTF_KEYUP;
          Event.ki.wScan = ::MapVirtualKey( VK_LSHIFT, 0 );
          EventQueue.push_back( Event );
      }
   }// End for

   if( hKeyboardLayout )
   {
       UnloadKeyboardLayout( hKeyboardLayout );
   }

   return ::SendInput( EventQueue.size(), &amp;amp;amp;amp;amp;EventQueue[0], sizeof( INPUT ));
}</pre>
Posted in Windows API Tagged: SendInput, Simulate keyboard, Simulate mouse, Using SendInput <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1963/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1963/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1963/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1963/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1963/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1963/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1963/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1963/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1963/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1963/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1963&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/08xmDL45U1I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/08/04/how-to-use-sendinput/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/08/04/how-to-use-sendinput/</feedburner:origLink></item>
		<item>
		<title>How to clear visual studio search history?</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/PWr8g8ek6yg/</link>
		<comments>http://nibuthomas.com/2009/07/15/how-to-clear-visual-studio-search-history/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 18:41:04 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[Visual studio]]></category>
		<category><![CDATA[Visual studio search history]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1956</guid>
		<description><![CDATA[Previous search terms of visual studio is stored in windows registry. The registry key for Visual Studio 9.0 is &#8230;
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Find
The search terms are arranged as &#8230;
Find 0
Find 1
Find 2
Delete them to clear search history.
Posted in Visual studio Tagged: Visual studio search history      <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1956&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Previous search terms of visual studio is stored in windows registry. The registry key for Visual Studio 9.0 is &#8230;</p>
<p>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Find</p>
<p>The search terms are arranged as &#8230;</p>
<p>Find 0<br />
Find 1<br />
Find 2</p>
<p>Delete them to clear search history.</p>
Posted in Visual studio Tagged: Visual studio search history <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1956/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1956/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1956/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1956/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1956/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1956/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1956/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1956/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1956/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1956/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1956&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/PWr8g8ek6yg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/07/15/how-to-clear-visual-studio-search-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/07/15/how-to-clear-visual-studio-search-history/</feedburner:origLink></item>
		<item>
		<title>auto keyword redefined in VC10</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/C8IdNAgzKJg/</link>
		<comments>http://nibuthomas.com/2009/07/14/auto-keyword-redefined-in-vc10/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 12:56:53 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[C++, VC++]]></category>
		<category><![CDATA[Visual studio]]></category>
		<category><![CDATA[auto keyword]]></category>
		<category><![CDATA[lamda expression]]></category>
		<category><![CDATA[VC10]]></category>
		<category><![CDATA[Visual Studio 10]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1934</guid>
		<description><![CDATA[auto keyword is one of those keywords that&#8217;s never used. So what the c++ committee has done is, they&#8217;ve started using it for a better purpose. For better understanding see this simple demo&#8230;
First without using auto keyword&#8230;

void AutoTest()
{
  typedef std::vector&#60;int&#62; IntVector;
  IntVector Ints;
  std::generate_n(std::back_inserter( Ints ), 100, rand);

  // After filling [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1934&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>auto</em> keyword is one of those keywords that&#8217;s never used. So what the c++ committee has done is, they&#8217;ve started using it for a better purpose. For better understanding see this simple demo&#8230;</p>
<p>First without using auto keyword&#8230;</p>
<pre class="brush: cpp;">
void AutoTest()
{
  typedef std::vector&lt;int&gt; IntVector;
  IntVector Ints;
  std::generate_n(std::back_inserter( Ints ), 100, rand);

  // After filling some elements into the vector, we iterate through them
  for( IntVector::iterator Itr = Ints.begin(); Itr != Ints.end(); ++Itr )
  {
    // Some code
  }
}</pre>
<p>Now let&#8217;s try with the <em>auto</em> keyword&#8230;</p>
<pre class="brush: cpp;">
void AutoTest()
{
  typedef std::vector&lt;/int&gt;&lt;int&gt; IntVector;
  IntVector Ints;
  std::generate_n(std::back_inserter( Ints ), 100, rand);

  // After filling some elements into the vector, we iterator through them
  for( auto Itr = Ints.begin(); Itr != Ints.end(); ++Itr )
  {
    // Some code
  }
}</pre>
<p>Hope you noticed the difference, the type for the variable <em>Itr</em> is automagically inferred by the compiler based on the return type from <em>Ints.begin()</em>.  Another huge benefit is when using <em>auto </em>keyword to wrap a lamda  expression (an anonymous/inline functor). See this example&#8230;</p>
<pre class="brush: cpp;">void LamdaTest()
{
   int x = 0;
   auto LamdaFunc = [&amp;x](int y)
   {
     while( y-- &gt; 0 )
     {
       ++x;
     }
   };

   LamdaFunc( 10 );
   LamdaFunc( 100 );

   std::cout &lt; &lt; &quot;Value of x after calling LamdaFunc is: &quot; &lt;&lt; x;
}</pre>
<p>For us it&#8217;s hard to infer or to know how to declare the type of this lamda expression but for the compiler it&#8217;s easy (well hope so). When we give auto keyword the type is auto inferred. We then use LamdaFunc object to invoke this lamda expression. In the end x will have the value 110. Note that the expression [&amp;x] means, pass x by reference. I&#8217;ll brag about lamda&#8217;s in my next post probably.</p>
<p>Cool isn&#8217;t it, I liked this feature. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </int></p>
Posted in C++, VC++, Visual studio Tagged: auto keyword, lamda expression, VC10, Visual Studio 10 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1934/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1934/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1934/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1934&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/C8IdNAgzKJg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/07/14/auto-keyword-redefined-in-vc10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/07/14/auto-keyword-redefined-in-vc10/</feedburner:origLink></item>
		<item>
		<title>CComPtr vs _com_ptr_t</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/7e-lCwT06DA/</link>
		<comments>http://nibuthomas.com/2009/07/14/ccomptr-vs-_com_ptr_t/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 09:11:12 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[C++, VC++]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[CComPtr]]></category>
		<category><![CDATA[_com_ptr_t]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1928</guid>
		<description><![CDATA[Recently a user asked this question in forums, I was quite able to answer his query. So thought this might be useful to you guys too.  
So the basic difference is that CComPtr is an ATL class is used with using ATL COM implementations while _com_ptr_t is one of the few COM support classes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1928&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently a user asked this question in forums, I was quite able to answer his query. So thought this might be useful to you guys too. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So<em> </em>the basic difference is that <em>CComPtr</em> is an <em>ATL</em> class is used with using <em>ATL COM</em> implementations while <em>_com_ptr_t</em> is one of the few <em>COM</em> <strong>support</strong> classes to support non <em>ATL COM</em> development. The definitions of these <em>COM</em> support classes go along with the tlb files and probably that&#8217;s why they are called as <em>COM</em> support classes. Also their definition can be found in <em>comdef.h</em> too. The other classes similar to<em> _com_ptr_t</em> are &#8230;</p>
<ol>
<li><em>_bstr_t</em></li>
<li><em>_com_error</em></li>
<li><em>_com_ptr_t</em></li>
<li><em>_variant_t</em></li>
</ol>
<p>So what are <em>COM</em> support classes? These are special lightweight classes that wraps basic useful <em>COM</em> functionality so that ideas like <em>COM</em> smart pointer typedefs over raw <em>COM</em> inteface classes works just by using <em>tlb</em> file. An example on how _com_ptr_t is used&#8230;</p>
<pre class="brush: cpp;">_COM_SMARTPTR_TYPEDEF(IMyInterface, __uuidof(IMyInterface));</pre>
<p>This above line declares <em>_com_ptr_t</em> specialization <em>IMyInterfacePtr</em>.</p>
<p>The library to link to for using <em>COM </em>support classes is <em>comsuppw.lib</em>.</p>
Posted in C++, VC++, COM Tagged: CComPtr, _com_ptr_t <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1928/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1928/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1928&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/7e-lCwT06DA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/07/14/ccomptr-vs-_com_ptr_t/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/07/14/ccomptr-vs-_com_ptr_t/</feedburner:origLink></item>
		<item>
		<title>Ordering output of out of order builds in Visual Studio</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/3h2yUtVLXwY/</link>
		<comments>http://nibuthomas.com/2009/06/02/ordering-output-of-out-of-order-builds-in-visual-studio/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 13:44:03 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[Visual studio]]></category>
		<category><![CDATA[Build order]]></category>
		<category><![CDATA[Ordered Build Output in Visual Studio]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1920</guid>
		<description><![CDATA[So what is an out of order build?
If you&#8217;ve got a multi-core processor then your compilation process will be distributed between these processors. One project will be built on one core while another one on a different core. Then all of these obj file will be gathered together during linking.
But one problem is that the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1920&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h4>So what is an out of order build?</h4>
<p>If you&#8217;ve got a multi-core processor then your compilation process will be distributed between these processors. One project will be built on one core while another one on a different core. Then all of these obj file will be gathered together during linking.</p>
<p>But one problem is that the output will look mangled, see this output&#8230;</p>
<div id="attachment_1921" class="wp-caption aligncenter" style="width: 459px"><img class="size-full wp-image-1921" title="Out of order builds" src="http://nibuthomas.files.wordpress.com/2009/06/out-of-order-builds.png?w=449&#038;h=163" alt="Out of order builds" width="449" height="163" /><p class="wp-caption-text">Out of order builds</p></div>
<p>The numbers on the left 3&gt;, 4&gt; uniquely identify a particular project being compiled. I&#8217;ve got two cores so effectively two projects can be compiled in parallel. But this is a mess particularly if you&#8217;ve got too many project&#8217;s you&#8217;ll have a hard time find out related projects, you&#8217;ll get tired of scrolling up and down. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But there is a way to overcome this, at the top of the output window (see above shot) there is a combo &#8220;Show output from:&#8221;. Change this to &#8220;Build Order&#8221; from &#8220;Build&#8221;, now this is how the output will look&#8230;</p>
<div id="attachment_1922" class="wp-caption aligncenter" style="width: 477px"><img class="size-full wp-image-1922" title="Build output ordered" src="http://nibuthomas.files.wordpress.com/2009/06/build-order.png?w=467&#038;h=157" alt="Build output ordered" width="467" height="157" /><p class="wp-caption-text">Build output ordered</p></div>
<p>Just to be complete; you can enable out of order builds via&#8230;</p>
<p>Tools-&gt;Options-&gt;Projects and Solutions-&gt;Build and Run-&gt;Maximum number of parallel project builds.</p>
<p>Here is a screenshot of this dialog.</p>
<div id="attachment_1924" class="wp-caption aligncenter" style="width: 654px"><img class="size-full wp-image-1924" title="Enable Out Of Order Builds" src="http://nibuthomas.files.wordpress.com/2009/06/enable-out-of-order-builds.png?w=644&#038;h=375" alt="Enable Out Of Order Builds" width="644" height="375" /><p class="wp-caption-text">Enable Out Of Order Builds</p></div>
<p>So enjoy working in this great IDE (well) <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
Posted in Visual studio Tagged: Build order, Ordered Build Output in Visual Studio <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1920/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1920/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1920/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1920/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1920/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1920/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1920/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1920/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1920/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1920/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1920&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/3h2yUtVLXwY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/06/02/ordering-output-of-out-of-order-builds-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>

		<media:content url="http://nibuthomas.files.wordpress.com/2009/06/out-of-order-builds.png" medium="image">
			<media:title type="html">Out of order builds</media:title>
		</media:content>

		<media:content url="http://nibuthomas.files.wordpress.com/2009/06/build-order.png" medium="image">
			<media:title type="html">Build output ordered</media:title>
		</media:content>

		<media:content url="http://nibuthomas.files.wordpress.com/2009/06/enable-out-of-order-builds.png" medium="image">
			<media:title type="html">Enable Out Of Order Builds</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/06/02/ordering-output-of-out-of-order-builds-in-visual-studio/</feedburner:origLink></item>
		<item>
		<title>Add horizontal scrollbar to a combo box</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/eaYid7PGupc/</link>
		<comments>http://nibuthomas.com/2009/05/28/add-horizontal-scrollbar-to-a-combo-box/#comments</comments>
		<pubDate>Thu, 28 May 2009 09:20:23 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[MFC]]></category>
		<category><![CDATA[Windows API]]></category>
		<category><![CDATA[CB_SETHORIZONTALEXTENT]]></category>
		<category><![CDATA[CComboBox]]></category>
		<category><![CDATA[Horizontal scrollbar for a combobox]]></category>
		<category><![CDATA[SetDroppedWidth]]></category>
		<category><![CDATA[SetHorizontalExtent]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1911</guid>
		<description><![CDATA[CComboBox has a function called SetHorizontalExtent which doesn&#8217;t work. SDK equivalent is CB_SETHORIZONTALEXTENT which also doesn&#8217;t work. The reason for this bug is pretty lame, because WS_HSCROLL style for combo box is not set, which in turn the VS dialog editor does not provide  . So a workaround is to open .rc file in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1911&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>CComboBox</em> has a function called <em>SetHorizontalExtent</em> which doesn&#8217;t work. SDK equivalent is <em>CB_SETHORIZONTALEXTENT</em> which also doesn&#8217;t work. The reason for this bug is pretty lame, because <em>WS_HSCROLL</em> style for combo box is not set, which in turn the VS dialog editor does not provide <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . So a workaround is to open .rc file in a text editor and add <em>WS_HSCROLL</em> style manually for this combo.</p>
<p>This is how a combo box will look with a horizontal scrollbar&#8230;</p>
<div id="attachment_1917" class="wp-caption aligncenter" style="width: 223px"><img class="size-full wp-image-1917" title="Horizontal scrollbar in a combo box" src="http://nibuthomas.files.wordpress.com/2009/05/combohscroll.png?w=213&#038;h=95" alt="Horizontal scrollbar in a combo box" width="213" height="95" /><p class="wp-caption-text">Horizontal scrollbar in a combo box</p></div>
<p>Here is a sample code from MSDN which is adapted a bit for this purpose&#8230;</p>
<pre class="brush: cpp;">void CDialoTestDlg::AddHScroll( CComboBox&amp; Cmb )
{
  // Find the longest string in the combo box.
  CString str;
  CSize sz;
  int dx = 0;

  TEXTMETRIC tm = { 0 };
  CDC* pDC = Cmb.GetDC();
  CFont* pFont = Cmb.GetFont();

  // Select the listbox font, save the old font
  CFont* pOldFont = pDC-&gt;SelectObject(pFont);

  // Get the text metrics for avg char width
  pDC-&gt;GetTextMetrics(&amp;tm);

  for (int i = 0; i &lt; Cmb.GetCount(); i++)
  {
    Cmb.GetLBText(i, str);
    sz = pDC-&gt;GetTextExtent(str);

    // Add the avg width to prevent clipping
    sz.cx += tm.tmAveCharWidth;

    if (sz.cx &gt; dx)
      dx = sz.cx;
  }

  // Select the old font back into the DC
  pDC-&gt;SelectObject(pOldFont);
  Cmb.ReleaseDC(pDC);

  // Set the horizontal extent so every character of all strings can
  // be scrolled to.
  Cmb.SetHorizontalExtent(dx);
}// End AddHScroll</pre>
<p>Setting horizontal extent is useful to prevent the combo&#8217;s drop down width from extending beyond screen limits. Note that there is another function called <em>SetDroppedWidth</em> which sets the drop down&#8217;s width but with no scrolling.</p>
Posted in MFC, Windows API Tagged: CB_SETHORIZONTALEXTENT, CComboBox, Horizontal scrollbar for a combobox, SetDroppedWidth, SetHorizontalExtent <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1911/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1911/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1911/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1911&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/eaYid7PGupc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/05/28/add-horizontal-scrollbar-to-a-combo-box/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>

		<media:content url="http://nibuthomas.files.wordpress.com/2009/05/combohscroll.png" medium="image">
			<media:title type="html">Horizontal scrollbar in a combo box</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/05/28/add-horizontal-scrollbar-to-a-combo-box/</feedburner:origLink></item>
		<item>
		<title>std::string caveat</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/MG9ax7uWmnI/</link>
		<comments>http://nibuthomas.com/2009/05/18/stdstring-caveat/#comments</comments>
		<pubDate>Mon, 18 May 2009 12:18:16 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[C++, VC++]]></category>
		<category><![CDATA[STL]]></category>
		<category><![CDATA[Strange bugs]]></category>
		<category><![CDATA[std::string]]></category>
		<category><![CDATA[string caveat]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1904</guid>
		<description><![CDATA[Never access an std::string&#8217;s buffer with an intent to increase/decrease it&#8217;s length nor pass such a buffer to functions which takes a char*. I did this mistake sometime back and got trapped in a strange bug with operator +=. This is how my code looked.
std::string str( ' ', MAX_PATH );
GetFolderName( pFullPath, &#38;str[0] ); // Oop
Problem [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1904&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Never access an <em>std::string</em>&#8217;s buffer with an intent to increase/decrease it&#8217;s length nor pass such a buffer to functions which takes a char*. I did this mistake sometime back and got trapped in a strange bug with operator +=. This is how my code looked.</p>
<pre class="brush: cpp;">std::string str( ' ', MAX_PATH );
GetFolderName( pFullPath, &amp;str[0] ); // Oop</pre>
<p>Problem with above code is that you won&#8217;t get an immediate crash since it&#8217;s a properly allocated buffer with <em>MAX_PATH</em> chars. But if you do further operations on such string expect plenty of inconsistencies. This is how my code looked after above piece of code&#8230;</p>
<pre class="brush: cpp;">str += &quot;\\&quot;; // Append backslash</pre>
<p>I was expecting a valid path with backslash appended towards it&#8217;s end, but this never happened and debugging with debugger too didn&#8217;t help.</p>
<p>So now let me tell you what the exact problem is! When you do <em>&amp;str[0]</em> you pass the address to the first char in <em>std::string</em>&#8217;s buffer. So when function <em>GetFolderName</em> fills in this buffer with folder path the length of std::string is not updated since it&#8217;s a C style function and it&#8217;s neither expected to do so. So the function terminates given buffer with a &#8221; with <em>std::string</em>&#8217;s length way high (<em>MAX_PATH</em>). So now when I do a += std::string internally fails some condition leading to unexpected results, note that this piece of code never caused a crash but I was quite lucky and watchful enough to fix this stupid bug. Sigh!</p>
<p>So watchout, there is no <em>CString::GetBuffer</em> or <em>CString::GetBufferSetLength</em> type of function for <em>std::string</em>, well at least for now.</p>
Posted in C++, VC++, STL, Strange bugs Tagged: std::string, Strange bugs, string caveat <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1904/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1904/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1904/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1904&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/MG9ax7uWmnI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/05/18/stdstring-caveat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/05/18/stdstring-caveat/</feedburner:origLink></item>
		<item>
		<title>Project Conversion Bug in VS2008</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/38lIBswWaV4/</link>
		<comments>http://nibuthomas.com/2009/05/11/project-conversion-bug-in-vs2008/#comments</comments>
		<pubDate>Mon, 11 May 2009 12:55:59 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[C++, VC++]]></category>
		<category><![CDATA[Strange bugs]]></category>
		<category><![CDATA[Visual studio]]></category>
		<category><![CDATA[Project Conversion Bug in VS2008]]></category>
		<category><![CDATA[VS2005]]></category>
		<category><![CDATA[VS2008]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1891</guid>
		<description><![CDATA[Are you having trouble with VS2008 after conversion from VS2005 to VS2008? Most common complaints are that the executable is way to slow when compared to it&#8217;s counterpart generated with VS2005. The reason for this is given in this MSDN forum thread have a look&#8230;
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/fb32033b-7bad-439b-a94c-943a17f0cbb2
The essence of this thread is given below (quote from the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1891&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Are you having trouble with VS2008 after conversion from VS2005 to VS2008? Most common complaints are that the executable is way to slow when compared to it&#8217;s counterpart generated with VS2005. The reason for this is given in this MSDN forum thread have a look&#8230;</p>
<p><a title="Reason for VC9 builds being slower than VC8 builds..." href="http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/fb32033b-7bad-439b-a94c-943a17f0cbb2" target="_blank">http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/fb32033b-7bad-439b-a94c-943a17f0cbb2</a></p>
<p>The essence of this thread is given below (quote from the thread, thanks to <a rel="nofollow" href="http://social.msdn.microsoft.com/Forums/en-US/user?user=Jon%20Baggott" target="_blank"><span class="name">Jon Baggott</span></a>)&#8230;</p>
<address> </address>
<address>In Visual Studio 2008 SP1 (SP1 not RTM) there is a serious bug with /O2 optimization. One way this bug can be triggered is by upgrading a project from a previous version. Even though the project setting shows the release build is set to /O2, the build can be not optimized at all. To work around it you have to change the setting to no optimization, apply, and then change it back to /O2. The quick way to see if this is needed is to check whether the setting for optimization is in bold or regular &#8211; if&#8217;s it&#8217;s bold you&#8217;re OK; if it&#8217;s regular text you&#8217;re not. This bug has been reported to Microsoft by many people over the past few months via the Connect feedback site but every case has been closed by them without doing anything and for completely invalid reasons.</address>
Posted in C++, VC++, Strange bugs, Visual studio Tagged: Project Conversion Bug in VS2008, VS2005, VS2008 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1891/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1891/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1891/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1891/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1891/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1891/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1891/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1891/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1891/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1891/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1891&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/38lIBswWaV4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/05/11/project-conversion-bug-in-vs2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/05/11/project-conversion-bug-in-vs2008/</feedburner:origLink></item>
		<item>
		<title>Where can I find MFC feature pack samples?</title>
		<link>http://feedproxy.google.com/~r/wordpress/svRz/~3/RaZzGqigkr4/</link>
		<comments>http://nibuthomas.com/2009/05/05/where-can-i-find-mfc-feature-pack-samples/#comments</comments>
		<pubDate>Tue, 05 May 2009 04:05:24 +0000</pubDate>
		<dc:creator>Nibu Thomas</dc:creator>
				<category><![CDATA[MFC]]></category>
		<category><![CDATA[Feature pack]]></category>
		<category><![CDATA[MFC Feature Pack]]></category>
		<category><![CDATA[MFC Feature Pack Samples]]></category>

		<guid isPermaLink="false">http://nibuthomas.com/?p=1887</guid>
		<description><![CDATA[People are having trouble finding feature pack samples installed in the samples directory. I too had a similar problem. So what you need to do is to uninstall the previous sample exe that you&#8217;ve installed. Then install the samples from here. Good thing about this is that you&#8217;ll have an updated samples package.
If you&#8217;re still [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1887&subd=nibuthomas&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>People are having trouble finding feature pack samples installed in the samples directory. I too had a similar problem. So what you need to do is to uninstall the previous sample exe that you&#8217;ve installed. Then install the samples from <a title="Feature pack samples" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=01AE159F-08CD-495B-8BF4-A48CC395AD7B&amp;displaylang=en" target="_blank">here</a>. Good thing about this is that you&#8217;ll have an updated samples package.</p>
<p>If you&#8217;re still having problems, I&#8217;ve uploaded them for you to my blog, please rename <a title="Save as zip or rename to zip after downloading" href="http://nibuthomas.files.wordpress.com/2009/04/featurepacksampleszip.jpeg" target="_blank">this file</a> to zip after downloading or save as zip.</p>
Posted in MFC Tagged: Feature pack, MFC Feature Pack, MFC Feature Pack Samples <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nibuthomas.wordpress.com/1887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nibuthomas.wordpress.com/1887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nibuthomas.wordpress.com/1887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nibuthomas.wordpress.com/1887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nibuthomas.wordpress.com/1887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nibuthomas.wordpress.com/1887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nibuthomas.wordpress.com/1887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nibuthomas.wordpress.com/1887/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nibuthomas.wordpress.com/1887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nibuthomas.wordpress.com/1887/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nibuthomas.com&blog=1142778&post=1887&subd=nibuthomas&ref=&feed=1" /></div><img src="http://feeds.feedburner.com/~r/wordpress/svRz/~4/RaZzGqigkr4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://nibuthomas.com/2009/05/05/where-can-i-find-mfc-feature-pack-samples/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eae4e1107091369567e5ad848f7ba956?s=96&amp;d=monsterid&amp;r=G" medium="image">
			<media:title type="html">NT</media:title>
		</media:content>
	<feedburner:origLink>http://nibuthomas.com/2009/05/05/where-can-i-find-mfc-feature-pack-samples/</feedburner:origLink></item>
	</channel>
</rss>
