<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>This Old Code - MFC</title>
    <link>http://thisoldcode.net/</link>
    <description>(Architecture + Development) ^ Testing = Product </description>
    <language>en-us</language>
    <copyright>Aaron Fischer</copyright>
    <lastBuildDate>Thu, 11 Oct 2007 02:07:08 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>aaron@microfisch.com</managingEditor>
    <webMaster>aaron@microfisch.com</webMaster>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=0a176e51-46f1-4385-93b8-6b5c9d4b26f7</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,0a176e51-46f1-4385-93b8-6b5c9d4b26f7.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,0a176e51-46f1-4385-93b8-6b5c9d4b26f7.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=0a176e51-46f1-4385-93b8-6b5c9d4b26f7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Since I deal with a large VC++ of native-managed code I am glad to see Somasegar's
list of <a href="http://blogs.msdn.com/somasegar/archive/2007/10/10/vc-performance-improvements-in-vs-2008.aspx" target="_blank">VC++
performance enhancements in Visual studio 2008</a></p>
        <blockquote>
          <p>
· Editor responsiveness – Updating IntelliSense, displaying the QuickInfo tooltip
and processing AutoComplete requests won’t degrade editor experience. 
</p>
          <p>
· Goto Definition improvements – Significant reduction in the time required to “Goto
Definition”.  One customer reported that a 2 minute delay dropped to 10-20 seconds. 
</p>
          <p>
· Load solution performance – Load time of large Visual C++ solutions is much better. 
Some customers are reporting speed ups of 25%-70%. 
</p>
          <p>
· File lookup in projects – Provides improvements to several scenarios such as adding
files to projects, changing configurations, etc. 
</p>
          <p>
· Changing configuration options – Modifying options, such as adding an include directory
or changing the active configuration, are much faster for large solutions. 
</p>
          <p>
· Reduced CPU consumption – We now process low-priority background items (such as
IntelliSense population) using 20% less CPU time.
</p>
        </blockquote>
        <p>
I have had to deal with slow IntelliSense and solution load times. All of these issues
affect my daily use of VS.  Its great that the VC++ is finally able to address
them.  Its even better to hear there will be a patch for VS 2005. <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=0a176e51-46f1-4385-93b8-6b5c9d4b26f7" /><br /><hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.
</p>
      </body>
      <title>Performance Improvements to VC++ in VS 2008</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,0a176e51-46f1-4385-93b8-6b5c9d4b26f7.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,0a176e51-46f1-4385-93b8-6b5c9d4b26f7.aspx</link>
      <pubDate>Thu, 11 Oct 2007 02:07:08 GMT</pubDate>
      <description>&lt;p&gt;
Since I deal with a large VC++ of native-managed code I am glad to see Somasegar's
list of &lt;a href="http://blogs.msdn.com/somasegar/archive/2007/10/10/vc-performance-improvements-in-vs-2008.aspx" target="_blank"&gt;VC++
performance enhancements in Visual studio 2008&lt;/a&gt;
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
· Editor responsiveness – Updating IntelliSense, displaying the QuickInfo tooltip
and processing AutoComplete requests won’t degrade editor experience. 
&lt;p&gt;
· Goto Definition improvements – Significant reduction in the time required to “Goto
Definition”.&amp;nbsp; One customer reported that a 2 minute delay dropped to 10-20 seconds. 
&lt;p&gt;
· Load solution performance – Load time of large Visual C++ solutions is much better.&amp;nbsp;
Some customers are reporting speed ups of 25%-70%. 
&lt;p&gt;
· File lookup in projects – Provides improvements to several scenarios such as adding
files to projects, changing configurations, etc. 
&lt;p&gt;
· Changing configuration options – Modifying options, such as adding an include directory
or changing the active configuration, are much faster for large solutions. 
&lt;p&gt;
· Reduced CPU consumption – We now process low-priority background items (such as
IntelliSense population) using 20% less CPU time.
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
I have had to deal with slow IntelliSense and solution load times. All of these issues
affect my daily use of VS.&amp;nbsp; Its great that the VC++ is finally able to address
them.&amp;nbsp; Its even better to hear there will be a patch for VS 2005. &lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=0a176e51-46f1-4385-93b8-6b5c9d4b26f7" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,0a176e51-46f1-4385-93b8-6b5c9d4b26f7.aspx</comments>
      <category>C++</category>
      <category>MFC</category>
      <category>Microsoft</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=4e4d4093-9ed0-432b-8fde-b9d1085e86f6</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,4e4d4093-9ed0-432b-8fde-b9d1085e86f6.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,4e4d4093-9ed0-432b-8fde-b9d1085e86f6.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=4e4d4093-9ed0-432b-8fde-b9d1085e86f6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Is it a Memory leak or a Resource leak.
</p>
        <p>
It would seem that if you take a c++ managed extensions gc class containing a native
pointer to dot net 2.0.  The classes finalization does not happen correctly. 
Ie the destructor is no longer invoked.
</p>
        <p>
further more if you migrate said c++ code to c++/cli then your destructor will
not get called when the managed object is disposed of via garbage collection. 
You will need to either explicitly call the destructor or add a finalize to your reference
class.
</p>
        <p>
 
</p>
        <p>
Not the most obvious memory leak in the world to say the least.
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=4e4d4093-9ed0-432b-8fde-b9d1085e86f6" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>A case of the AWAL Destructor.</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,4e4d4093-9ed0-432b-8fde-b9d1085e86f6.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,4e4d4093-9ed0-432b-8fde-b9d1085e86f6.aspx</link>
      <pubDate>Thu, 02 Aug 2007 17:39:54 GMT</pubDate>
      <description>&lt;p&gt;
Is it a Memory leak or a Resource leak.
&lt;/p&gt;
&lt;p&gt;
It would seem that if you take a c++ managed extensions gc class containing a native
pointer to&amp;nbsp;dot net 2.0.&amp;nbsp; The classes finalization does not happen correctly.&amp;nbsp;
Ie the destructor is no longer invoked.
&lt;/p&gt;
&lt;p&gt;
further more if&amp;nbsp;you migrate said c++ code to c++/cli then your destructor will
not get called when the managed object is disposed of via garbage collection.&amp;nbsp;
You will need to either explicitly call the destructor or add a finalize to your reference
class.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Not the most obvious memory leak in the world to say the least.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=4e4d4093-9ed0-432b-8fde-b9d1085e86f6" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,4e4d4093-9ed0-432b-8fde-b9d1085e86f6.aspx</comments>
      <category>C++</category>
      <category>DotNet</category>
      <category>MFC</category>
      <category>Microsoft</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=9c81c596-d168-46e2-b065-981a8c35a784</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,9c81c596-d168-46e2-b065-981a8c35a784.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,9c81c596-d168-46e2-b065-981a8c35a784.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=9c81c596-d168-46e2-b065-981a8c35a784</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <pre class="csharpcode">
          <span class="kwrd">Public</span>
          <span class="kwrd">Module</span> ConversionModule <span class="kwrd">Public</span><span class="kwrd">Sub</span> UpdateToCLI()
SeachAndReplaceDocumentPointers(<span class="str">"System::"</span>) SeachAndReplaceDocumentPointers(<span class="str">"nsoftware::IPWorksSSL::IPWorksSSLException"</span>)
SeachAndReplaceDocumentPointers(<span class="str">"nsoftware::IPWorksSSL::HttpsStatusEventArgs"</span>)
SeachAndReplaceDocumentPointers(<span class="str">"nsoftware::IPWorksSSL::HttpsStatusEventArgs"</span>)
SeachAndReplaceDocumentPointers(<span class="str">"C1::Win::C1FlexGrid::"</span>)
SeachAndReplaceDocumentPointers(<span class="str">"C1::"</span>) FindReplace(<span class="str">"__gc
"</span>, <span class="str">"ref "</span>) FindReplace(<span class="str">"__property"</span>, <span class="str">"property"</span>)
FindReplace(<span class="str">"__try_cast"</span>, <span class="str">"safe_cast"</span>)
FindReplace(<span class="str">" S"</span><span class="str">""</span>, <span class="str">"
"</span><span class="str">""</span>) FindReplace(<span class="str">"(S"</span><span class="str">""</span>, <span class="str">"("</span><span class="str">""</span>) <span class="rem">'FindReplace("
S"",""")</span> NewToGCnew(<span class="str">"System"</span>) NewToGCnew(<span class="str">"nsoftware"</span>)
NewToGCnew(<span class="str">"C1FlexGrid"</span>) NewToGCnew(<span class="str">"C1::"</span>)
ReplaceTypeOf() ReplaceItemOf() FindReplace(<span class="str">"-&gt;ItemOf"</span>, <span class="str">"-&gt;default"</span>)
FindReplace(<span class="str">"-&gt;Item"</span>, <span class="str">"-&gt;default"</span>) <span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> SeachAndReplaceDocumentPointers(<span class="kwrd">ByVal</span> ManagedNameSpaceToken <span class="kwrd">As</span><span class="kwrd">String</span>)
SeachAndReplacePointers(ManagedNameSpaceToken + <span class="str">"*\*"</span>, <span class="str">"^"</span>)
SeachAndReplacePointers(ManagedNameSpaceToken + <span class="str">"\*"</span>, <span class="str">"^"</span>)
SeachAndReplacePointers(ManagedNameSpaceToken + <span class="str">"*^ &amp;"</span>, <span class="str">"%"</span>)
SeachAndReplacePointers(ManagedNameSpaceToken + <span class="str">"*^&amp;"</span>, <span class="str">"%"</span>)
SeachAndReplacePointers(ManagedNameSpaceToken + <span class="str">"*^ \*"</span>, <span class="str">"%"</span>)
SeachAndReplacePointers(ManagedNameSpaceToken + <span class="str">"*^\*"</span>, <span class="str">"%"</span>) <span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> SeachAndReplacePointers(<span class="kwrd">ByVal</span> What <span class="kwrd">As</span><span class="kwrd">String</span>, <span class="kwrd">ByVal</span> ReplaceWith <span class="kwrd">As</span><span class="kwrd">String</span>) <span class="kwrd">Do</span> DTE.Windows.Item(DTE.ActiveDocument.Name).Activate()
DTE.Find.FindWhat = What DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.Backwards
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind <span class="kwrd">If</span> (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound) <span class="kwrd">Then</span><span class="kwrd">Exit</span><span class="kwrd">Do</span><span class="kwrd">Else</span> DTE.ActiveDocument.Selection.CharRight()
DTE.ActiveDocument.Selection.DeleteLeft() DTE.ActiveDocument.Selection.Text = ReplaceWith <span class="kwrd">End</span><span class="kwrd">If</span><span class="kwrd">Loop</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> FindReplace(<span class="kwrd">ByVal</span> What <span class="kwrd">As</span><span class="kwrd">String</span>, <span class="kwrd">ByVal</span> ReplaceWith <span class="kwrd">As</span><span class="kwrd">String</span>)
DTE.Find.Action = vsFindAction.vsFindActionReplaceAll DTE.Find.FindWhat = What DTE.Find.ReplaceWith
= ReplaceWith DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase
= <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.MatchInHiddenText
= <span class="kwrd">False</span> DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxWildcards
DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone DTE.Find.Action
= vsFindAction.vsFindActionReplaceAll DTE.Find.Execute() <span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> NewToGCnew(<span class="kwrd">ByVal</span> Type <span class="kwrd">As</span><span class="kwrd">String</span>) <span class="kwrd">Do</span> DTE.Find.FindWhat
= <span class="str">" new "</span> + Type + <span class="str">"*"</span> DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord
= <span class="kwrd">False</span> DTE.Find.Backwards = <span class="kwrd">False</span> DTE.Find.MatchInHiddenText
= <span class="kwrd">False</span> DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxWildcards
DTE.Find.Action = vsFindAction.vsFindActionFind <span class="kwrd">If</span> (<span class="kwrd">Not</span> (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) <span class="kwrd">Then</span> DTE.Find.Action
= vsFindAction.vsFindActionReplace DTE.Find.ReplaceWith = <span class="str">" gcnew
"</span> DTE.Find.FindWhat = <span class="str">" new "</span> DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.Backwards
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Execute() <span class="kwrd">Else</span><span class="kwrd">Exit</span><span class="kwrd">Do</span><span class="kwrd">End</span><span class="kwrd">If</span><span class="kwrd">Loop</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> ReplaceTypeOf() <span class="kwrd">Do</span> DTE.Find.FindWhat
= <span class="str">"__typeof(*)"</span> DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.Backwards
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind <span class="kwrd">If</span> (<span class="kwrd">Not</span> (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) <span class="kwrd">Then</span> DTE.ActiveDocument.Selection.CharLeft()
DTE.ActiveDocument.Selection.CharRight(<span class="kwrd">True</span>, 9) DTE.ActiveDocument.Selection.Delete()
DTE.Find.FindWhat = <span class="str">")"</span> DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.Backwards
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind <span class="kwrd">If</span> (<span class="kwrd">Not</span> (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) <span class="kwrd">Then</span> DTE.ActiveDocument.Selection.Text
= <span class="str">"::typeid"</span><span class="kwrd">End</span><span class="kwrd">If</span><span class="kwrd">Else</span><span class="kwrd">Exit</span><span class="kwrd">Do</span><span class="kwrd">End</span><span class="kwrd">If</span><span class="kwrd">Loop</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> ReplaceItemOf() <span class="kwrd">Do</span> DTE.Find.FindWhat
= <span class="str">"get_ItemOf"</span> DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.Backwards
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind <span class="kwrd">If</span> (<span class="kwrd">Not</span> (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) <span class="kwrd">Then</span> DTE.ActiveDocument.Selection.Delete()
DTE.ActiveDocument.Selection.Text = <span class="str">"default["</span> DTE.Find.FindWhat
= <span class="str">")"</span> DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.Backwards
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind <span class="kwrd">If</span> (<span class="kwrd">Not</span> (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) <span class="kwrd">Then</span> DTE.ActiveDocument.Selection.Text
= <span class="str">"]"</span><span class="kwrd">End</span><span class="kwrd">If</span><span class="kwrd">Else</span><span class="kwrd">Exit</span><span class="kwrd">Do</span><span class="kwrd">End</span><span class="kwrd">If</span><span class="kwrd">Loop</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> WrapCStringWithSystemString()
DTE.ActiveDocument.Selection.Text = <span class="str">" gcnew System::String( "</span> +
DTE.ActiveDocument.Selection.Text + <span class="str">" )"</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> WrapSystemStringWithCString()
DTE.ActiveDocument.Selection.Text = <span class="str">" CString( "</span> + DTE.ActiveDocument.Selection.Text
+ <span class="str">" )"</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> WrapValueArray()
DTE.ActiveDocument.Selection.Text = <span class="str">"array&lt; "</span> + DTE.ActiveDocument.Selection.Text
+ <span class="str">" &gt; ^"</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> WrapHandle()
DTE.ActiveDocument.Selection.Text = <span class="str">"(HWND)"</span> + DTE.ActiveDocument.Selection.Text
+ <span class="str">".ToPointer()"</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> ConvertToNull()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = <span class="str">"NULL"</span> DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.Execute() DTE.ActiveDocument.Selection.Text
= <span class="str">"nullptr"</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> updateDefaultI()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = <span class="str">"default(i)"</span> DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.Execute() DTE.ActiveDocument.Selection.Text
= <span class="str">"default[i]"</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> UpdateToGCNew()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = <span class="str">"
new "</span> DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase
= <span class="kwrd">False</span> DTE.Find.MatchWholeWord = <span class="kwrd">False</span> DTE.Find.Backwards
= <span class="kwrd">False</span> DTE.Find.MatchInHiddenText = <span class="kwrd">False</span> DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Execute() DTE.ActiveDocument.Selection.Text
= <span class="str">" gcnew "</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> UpdateHat()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = <span class="str">"\*"</span> DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = <span class="kwrd">False</span> DTE.Find.MatchWholeWord
= <span class="kwrd">False</span> DTE.Find.Backwards = <span class="kwrd">False</span> DTE.Find.MatchInHiddenText
= <span class="kwrd">False</span> DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxWildcards
DTE.Find.Execute() DTE.ActiveDocument.Selection.Text = <span class="str">"^"</span><span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">Sub</span> UpdateHatAndGcNew()
UpdateHat() UpdateToGCNew() <span class="kwrd">End</span><span class="kwrd">Sub</span><span class="kwrd">End</span> Module</pre>
        <style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=9c81c596-d168-46e2-b065-981a8c35a784" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Macros For converting C++ extensions to cli</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,9c81c596-d168-46e2-b065-981a8c35a784.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,9c81c596-d168-46e2-b065-981a8c35a784.aspx</link>
      <pubDate>Mon, 09 Jul 2007 15:19:06 GMT</pubDate>
      <description>&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Module&lt;/span&gt; ConversionModule &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; UpdateToCLI()
SeachAndReplaceDocumentPointers(&lt;span class="str"&gt;"System::"&lt;/span&gt;) SeachAndReplaceDocumentPointers(&lt;span class="str"&gt;"nsoftware::IPWorksSSL::IPWorksSSLException"&lt;/span&gt;)
SeachAndReplaceDocumentPointers(&lt;span class="str"&gt;"nsoftware::IPWorksSSL::HttpsStatusEventArgs"&lt;/span&gt;)
SeachAndReplaceDocumentPointers(&lt;span class="str"&gt;"nsoftware::IPWorksSSL::HttpsStatusEventArgs"&lt;/span&gt;)
SeachAndReplaceDocumentPointers(&lt;span class="str"&gt;"C1::Win::C1FlexGrid::"&lt;/span&gt;)
SeachAndReplaceDocumentPointers(&lt;span class="str"&gt;"C1::"&lt;/span&gt;) FindReplace(&lt;span class="str"&gt;"__gc
"&lt;/span&gt;, &lt;span class="str"&gt;"ref "&lt;/span&gt;) FindReplace(&lt;span class="str"&gt;"__property"&lt;/span&gt;, &lt;span class="str"&gt;"property"&lt;/span&gt;)
FindReplace(&lt;span class="str"&gt;"__try_cast"&lt;/span&gt;, &lt;span class="str"&gt;"safe_cast"&lt;/span&gt;)
FindReplace(&lt;span class="str"&gt;" S"&lt;/span&gt;&lt;span class="str"&gt;""&lt;/span&gt;, &lt;span class="str"&gt;"
"&lt;/span&gt;&lt;span class="str"&gt;""&lt;/span&gt;) FindReplace(&lt;span class="str"&gt;"(S"&lt;/span&gt;&lt;span class="str"&gt;""&lt;/span&gt;, &lt;span class="str"&gt;"("&lt;/span&gt;&lt;span class="str"&gt;""&lt;/span&gt;) &lt;span class="rem"&gt;'FindReplace("
S"",""")&lt;/span&gt; NewToGCnew(&lt;span class="str"&gt;"System"&lt;/span&gt;) NewToGCnew(&lt;span class="str"&gt;"nsoftware"&lt;/span&gt;)
NewToGCnew(&lt;span class="str"&gt;"C1FlexGrid"&lt;/span&gt;) NewToGCnew(&lt;span class="str"&gt;"C1::"&lt;/span&gt;)
ReplaceTypeOf() ReplaceItemOf() FindReplace(&lt;span class="str"&gt;"-&amp;gt;ItemOf"&lt;/span&gt;, &lt;span class="str"&gt;"-&amp;gt;default"&lt;/span&gt;)
FindReplace(&lt;span class="str"&gt;"-&amp;gt;Item"&lt;/span&gt;, &lt;span class="str"&gt;"-&amp;gt;default"&lt;/span&gt;) &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; SeachAndReplaceDocumentPointers(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; ManagedNameSpaceToken &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;)
SeachAndReplacePointers(ManagedNameSpaceToken + &lt;span class="str"&gt;"*\*"&lt;/span&gt;, &lt;span class="str"&gt;"^"&lt;/span&gt;)
SeachAndReplacePointers(ManagedNameSpaceToken + &lt;span class="str"&gt;"\*"&lt;/span&gt;, &lt;span class="str"&gt;"^"&lt;/span&gt;)
SeachAndReplacePointers(ManagedNameSpaceToken + &lt;span class="str"&gt;"*^ &amp;amp;"&lt;/span&gt;, &lt;span class="str"&gt;"%"&lt;/span&gt;)
SeachAndReplacePointers(ManagedNameSpaceToken + &lt;span class="str"&gt;"*^&amp;amp;"&lt;/span&gt;, &lt;span class="str"&gt;"%"&lt;/span&gt;)
SeachAndReplacePointers(ManagedNameSpaceToken + &lt;span class="str"&gt;"*^ \*"&lt;/span&gt;, &lt;span class="str"&gt;"%"&lt;/span&gt;)
SeachAndReplacePointers(ManagedNameSpaceToken + &lt;span class="str"&gt;"*^\*"&lt;/span&gt;, &lt;span class="str"&gt;"%"&lt;/span&gt;) &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; SeachAndReplacePointers(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; What &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; ReplaceWith &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;) &lt;span class="kwrd"&gt;Do&lt;/span&gt; DTE.Windows.Item(DTE.ActiveDocument.Name).Activate()
DTE.Find.FindWhat = What DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind &lt;span class="kwrd"&gt;If&lt;/span&gt; (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound) &lt;span class="kwrd"&gt;Then&lt;/span&gt; &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Do&lt;/span&gt; &lt;span class="kwrd"&gt;Else&lt;/span&gt; DTE.ActiveDocument.Selection.CharRight()
DTE.ActiveDocument.Selection.DeleteLeft() DTE.ActiveDocument.Selection.Text = ReplaceWith &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Loop&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; FindReplace(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; What &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; ReplaceWith &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;)
DTE.Find.Action = vsFindAction.vsFindActionReplaceAll DTE.Find.FindWhat = What DTE.Find.ReplaceWith
= ReplaceWith DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxWildcards
DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone DTE.Find.Action
= vsFindAction.vsFindActionReplaceAll DTE.Find.Execute() &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; NewToGCnew(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; Type &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;) &lt;span class="kwrd"&gt;Do&lt;/span&gt; DTE.Find.FindWhat
= &lt;span class="str"&gt;" new "&lt;/span&gt; + Type + &lt;span class="str"&gt;"*"&lt;/span&gt; DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxWildcards
DTE.Find.Action = vsFindAction.vsFindActionFind &lt;span class="kwrd"&gt;If&lt;/span&gt; (&lt;span class="kwrd"&gt;Not&lt;/span&gt; (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) &lt;span class="kwrd"&gt;Then&lt;/span&gt; DTE.Find.Action
= vsFindAction.vsFindActionReplace DTE.Find.ReplaceWith = &lt;span class="str"&gt;" gcnew
"&lt;/span&gt; DTE.Find.FindWhat = &lt;span class="str"&gt;" new "&lt;/span&gt; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Execute() &lt;span class="kwrd"&gt;Else&lt;/span&gt; &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Do&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Loop&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; ReplaceTypeOf() &lt;span class="kwrd"&gt;Do&lt;/span&gt; DTE.Find.FindWhat
= &lt;span class="str"&gt;"__typeof(*)"&lt;/span&gt; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind &lt;span class="kwrd"&gt;If&lt;/span&gt; (&lt;span class="kwrd"&gt;Not&lt;/span&gt; (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) &lt;span class="kwrd"&gt;Then&lt;/span&gt; DTE.ActiveDocument.Selection.CharLeft()
DTE.ActiveDocument.Selection.CharRight(&lt;span class="kwrd"&gt;True&lt;/span&gt;, 9) DTE.ActiveDocument.Selection.Delete()
DTE.Find.FindWhat = &lt;span class="str"&gt;")"&lt;/span&gt; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind &lt;span class="kwrd"&gt;If&lt;/span&gt; (&lt;span class="kwrd"&gt;Not&lt;/span&gt; (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) &lt;span class="kwrd"&gt;Then&lt;/span&gt; DTE.ActiveDocument.Selection.Text
= &lt;span class="str"&gt;"::typeid"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Else&lt;/span&gt; &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Do&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Loop&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; ReplaceItemOf() &lt;span class="kwrd"&gt;Do&lt;/span&gt; DTE.Find.FindWhat
= &lt;span class="str"&gt;"get_ItemOf"&lt;/span&gt; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind &lt;span class="kwrd"&gt;If&lt;/span&gt; (&lt;span class="kwrd"&gt;Not&lt;/span&gt; (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) &lt;span class="kwrd"&gt;Then&lt;/span&gt; DTE.ActiveDocument.Selection.Delete()
DTE.ActiveDocument.Selection.Text = &lt;span class="str"&gt;"default["&lt;/span&gt; DTE.Find.FindWhat
= &lt;span class="str"&gt;")"&lt;/span&gt; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Action = vsFindAction.vsFindActionFind &lt;span class="kwrd"&gt;If&lt;/span&gt; (&lt;span class="kwrd"&gt;Not&lt;/span&gt; (DTE.Find.Execute()
= vsFindResult.vsFindResultNotFound)) &lt;span class="kwrd"&gt;Then&lt;/span&gt; DTE.ActiveDocument.Selection.Text
= &lt;span class="str"&gt;"]"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Else&lt;/span&gt; &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Do&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Loop&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; WrapCStringWithSystemString()
DTE.ActiveDocument.Selection.Text = &lt;span class="str"&gt;" gcnew System::String( "&lt;/span&gt; +
DTE.ActiveDocument.Selection.Text + &lt;span class="str"&gt;" )"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; WrapSystemStringWithCString()
DTE.ActiveDocument.Selection.Text = &lt;span class="str"&gt;" CString( "&lt;/span&gt; + DTE.ActiveDocument.Selection.Text
+ &lt;span class="str"&gt;" )"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; WrapValueArray()
DTE.ActiveDocument.Selection.Text = &lt;span class="str"&gt;"array&amp;lt; "&lt;/span&gt; + DTE.ActiveDocument.Selection.Text
+ &lt;span class="str"&gt;" &amp;gt; ^"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; WrapHandle()
DTE.ActiveDocument.Selection.Text = &lt;span class="str"&gt;"(HWND)"&lt;/span&gt; + DTE.ActiveDocument.Selection.Text
+ &lt;span class="str"&gt;".ToPointer()"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; ConvertToNull()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = &lt;span class="str"&gt;"NULL"&lt;/span&gt; DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.Execute() DTE.ActiveDocument.Selection.Text
= &lt;span class="str"&gt;"nullptr"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; updateDefaultI()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = &lt;span class="str"&gt;"default(i)"&lt;/span&gt; DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.Execute() DTE.ActiveDocument.Selection.Text
= &lt;span class="str"&gt;"default[i]"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; UpdateToGCNew()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = &lt;span class="str"&gt;"
new "&lt;/span&gt; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax
= vsFindPatternSyntax.vsFindPatternSyntaxWildcards DTE.Find.Execute() DTE.ActiveDocument.Selection.Text
= &lt;span class="str"&gt;" gcnew "&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; UpdateHat()
DTE.Find.Action = vsFindAction.vsFindActionFind DTE.Find.FindWhat = &lt;span class="str"&gt;"\*"&lt;/span&gt; DTE.Find.Target
= vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchWholeWord
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.Backwards = &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.MatchInHiddenText
= &lt;span class="kwrd"&gt;False&lt;/span&gt; DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxWildcards
DTE.Find.Execute() DTE.ActiveDocument.Selection.Text = &lt;span class="str"&gt;"^"&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; UpdateHatAndGcNew()
UpdateHat() UpdateToGCNew() &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;span class="kwrd"&gt;End&lt;/span&gt; Module&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=9c81c596-d168-46e2-b065-981a8c35a784" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,9c81c596-d168-46e2-b065-981a8c35a784.aspx</comments>
      <category>C++</category>
      <category>MFC</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=9dea678e-fe5e-4952-a4db-bac69cbe5a2e</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,9dea678e-fe5e-4952-a4db-bac69cbe5a2e.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,9dea678e-fe5e-4952-a4db-bac69cbe5a2e.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=9dea678e-fe5e-4952-a4db-bac69cbe5a2e</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If your moving MFC or C++ extensions to dot net 2.0 here are a few items you might
find useful
</p>
        <ul>
          <li>
Dudelabs offers <a href="http://www.dudelabs.com/Products.aspx">RC converter</a> which
will take MFC resource files and convert them into Winform ( I have played with the
demo it looks like it will help this conversion process).</li>
          <li>
Microsoft offers VC++ 2003 Managed Extensions to VC++2005 C++/CLI Conversion Tool,
a tool that was never finished but allows help for converting managed extensions to
C++/CLI.  You can down load it <a href="http://www.microsoft.com/downloads/details.aspx?familyid=a3581805-1af2-4c34-9d0e-6029cc078441&amp;displaylang=en">here</a></li>
          <li>
Microsoft has a <a href="http://msdn2.microsoft.com/en-us/library/ms235289%28vs.80%29.aspx">C++/CLI
Migration Primer</a> that is worth a read.</li>
          <li>
Microsoft also has <a href="http://msdn2.microsoft.com/en-us/library/b23b94s7%28vs.80%29.aspx">Managed
Extensions for C++ Syntax Upgrade Checklist</a> article.</li>
          <li>
Another Microsoft article <a href="http://msdn2.microsoft.com/en-us/library/ms379603%28VS.80%29.aspx">Translation
Guide: Moving Your Programs from Managed Extensions for C++ to C++/CLI</a></li>
          <li>
Codeproject has dot net <a title="http://www.codeproject.com/csharp/doctoolkit.asp" href="http://www.codeproject.com/csharp/doctoolkit.asp">Document
Management Toolkit Library</a> adds the idea of document/view</li>
          <li>
Codeproject also has <a href="http://www.codeproject.com/csharp/sdimdiwizards.asp">C#
SDI/MDI Application wizards</a></li>
          <li>
Codeguru has a article on Converting dialog resources to C# forms <a href="http://www.codeguru.com/Cpp/V-S/devstudio_macros/visualstudionet/article.php/c3199">Dialog
Resource to C# Form Converter</a></li>
        </ul>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=9dea678e-fe5e-4952-a4db-bac69cbe5a2e" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Some Links for Moving Between C++ Versions or to C#</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,9dea678e-fe5e-4952-a4db-bac69cbe5a2e.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,9dea678e-fe5e-4952-a4db-bac69cbe5a2e.aspx</link>
      <pubDate>Fri, 15 Jun 2007 21:50:33 GMT</pubDate>
      <description>&lt;p&gt;
If your moving MFC or C++ extensions to dot net 2.0 here are a few items you might
find useful
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Dudelabs offers &lt;a href="http://www.dudelabs.com/Products.aspx"&gt;RC converter&lt;/a&gt; which
will take MFC resource files and convert them into Winform ( I have played with the
demo it looks like it will help this conversion process).&lt;/li&gt;
&lt;li&gt;
Microsoft offers VC++ 2003 Managed Extensions to VC++2005 C++/CLI Conversion Tool,
a tool that was never finished but allows help for converting managed extensions to
C++/CLI.&amp;nbsp; You can down load it &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=a3581805-1af2-4c34-9d0e-6029cc078441&amp;amp;displaylang=en"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Microsoft has a &lt;a href="http://msdn2.microsoft.com/en-us/library/ms235289%28vs.80%29.aspx"&gt;C++/CLI
Migration Primer&lt;/a&gt; that is worth a read.&lt;/li&gt;
&lt;li&gt;
Microsoft also has &lt;a href="http://msdn2.microsoft.com/en-us/library/b23b94s7%28vs.80%29.aspx"&gt;Managed
Extensions for C++ Syntax Upgrade Checklist&lt;/a&gt;&amp;nbsp;article.&lt;/li&gt;
&lt;li&gt;
Another Microsoft article &lt;a href="http://msdn2.microsoft.com/en-us/library/ms379603%28VS.80%29.aspx"&gt;Translation
Guide: Moving Your Programs from Managed Extensions for C++ to C++/CLI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Codeproject has dot net &lt;a title="http://www.codeproject.com/csharp/doctoolkit.asp" href="http://www.codeproject.com/csharp/doctoolkit.asp"&gt;Document
Management Toolkit Library&lt;/a&gt;&amp;nbsp;adds the idea of document/view&lt;/li&gt;
&lt;li&gt;
Codeproject also has &lt;a href="http://www.codeproject.com/csharp/sdimdiwizards.asp"&gt;C#
SDI/MDI Application wizards&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Codeguru has a article on Converting dialog resources to C# forms &lt;a href="http://www.codeguru.com/Cpp/V-S/devstudio_macros/visualstudionet/article.php/c3199"&gt;Dialog
Resource to C# Form Converter&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=9dea678e-fe5e-4952-a4db-bac69cbe5a2e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,9dea678e-fe5e-4952-a4db-bac69cbe5a2e.aspx</comments>
      <category>C++</category>
      <category>DotNet</category>
      <category>MFC</category>
      <category>Microsoft</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=31e39f50-eef8-426c-a5d8-745ac00484c8</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,31e39f50-eef8-426c-a5d8-745ac00484c8.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,31e39f50-eef8-426c-a5d8-745ac00484c8.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=31e39f50-eef8-426c-a5d8-745ac00484c8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
Last night I got a letter from MSDN.  If you have been in away and missed it
the Daylight Saving Time has changed read on to see what might be affected if you
use DOT NET or CRT.
</p>
        <blockquote>
          <p>
            <b>Dear Valued Microsoft Customer,<br /></b>In 2005, the United States government passed the Energy Policy Act of 2005. This
act changes the start and end dates for Daylight Saving Time (DST) as of spring 2007.
These changes may impact the way applications run. Microsoft is releasing an update
for Windows through Microsoft Update that reflects these changes.<br />
Developers who use the .NET Framework may find their applications affected if the
application uses the time zone information for historical purposes or if they have
derived custom classes from <a href="http://msdn2.microsoft.com/en-us/library/system.timezone.aspx">System.TimeZone</a> to
provide custom time zone information. The standard System.TimeZone class provides
a managed wrapper for the underlying Windows Operating System time zone functions.<br />
In addition, developers who use Visual C++ may find their applications affected if
they use the CRT time functions, or the TZ environment variable. Microsoft is currently
working on a fix for this issue and will post information about its availability on
the <a href="http://msdn2.microsoft.com/en-us/vstudio/aa718682.aspx">Visual Studio
Support</a> page.<br />
Most applications that use these affected classes will not need to be modified as
this update will ensure that the correct data is provided seamlessly to the application.
However, applications that use these classes or the underlying <a href="http://msdn2.microsoft.com/en-us/library/ms725479.aspx">Windows
API</a> to perform historical time look-ups will need to be modified.<br />
In most cases, developers who have extended the .NET Framework’s time zone support
by creating custom time zone classes derived from System.TimeZone, or by direct access
to the Win32 API, will not have to update their applications as long as the available
updates to the operating system are applied. However, solutions that rely on private
time zone data, or that retrieve system time zone information by accessing the registry
directly, may need to be updated. Applications that deal with historical time zone
data may also need to be updated.<br />
Microsoft advises all developers who make use of time zone data to test their applications
against this update to ensure that their applications function correctly.<br />
For more detailed information and the latest updates please visit <a href="http://msdn2.microsoft.com/en-us/vstudio/bb264729.aspx">http://msdn2.microsoft.com/en-us/vstudio/bb264729.aspx</a>, <a href="http://support.microsoft.com/gp/cp_dst">Preparing
for daylight saving time changes in 2007</a>, and <a href="http://support.microsoft.com/kb/928388">KB928388:
2007 time zone update for Microsoft Windows operating systems</a></p>
        </blockquote>
        <br />
Update: I corrected all links.<br /><img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=31e39f50-eef8-426c-a5d8-745ac00484c8" /><br /><hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Daylight Saving Time has Changed- don't be caught off guard.</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,31e39f50-eef8-426c-a5d8-745ac00484c8.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,31e39f50-eef8-426c-a5d8-745ac00484c8.aspx</link>
      <pubDate>Fri, 23 Feb 2007 14:11:21 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Last night I got a letter from MSDN.&amp;nbsp; If you have been in away and missed it
the Daylight Saving Time has changed read on to see what might be affected if you
use DOT NET or CRT.
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;b&gt;Dear Valued Microsoft Customer,&lt;br&gt;
&lt;/b&gt;In 2005, the United States government passed the Energy Policy Act of 2005. This
act changes the start and end dates for Daylight Saving Time (DST) as of spring 2007.
These changes may impact the way applications run. Microsoft is releasing an update
for Windows through Microsoft Update that reflects these changes.&lt;br&gt;
Developers who use the .NET Framework may find their applications affected if the
application uses the time zone information for historical purposes or if they have
derived custom classes from &lt;a href="http://msdn2.microsoft.com/en-us/library/system.timezone.aspx"&gt;System.TimeZone&lt;/a&gt; to
provide custom time zone information. The standard System.TimeZone class provides
a managed wrapper for the underlying Windows Operating System time zone functions.&lt;br&gt;
In addition, developers who use Visual C++ may find their applications affected if
they use the CRT time functions, or the TZ environment variable. Microsoft is currently
working on a fix for this issue and will post information about its availability on
the &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/aa718682.aspx"&gt;Visual Studio
Support&lt;/a&gt; page.&lt;br&gt;
Most applications that use these affected classes will not need to be modified as
this update will ensure that the correct data is provided seamlessly to the application.
However, applications that use these classes or the underlying &lt;a href="http://msdn2.microsoft.com/en-us/library/ms725479.aspx"&gt;Windows
API&lt;/a&gt; to perform historical time look-ups will need to be modified.&lt;br&gt;
In most cases, developers who have extended the .NET Framework’s time zone support
by creating custom time zone classes derived from System.TimeZone, or by direct access
to the Win32 API, will not have to update their applications as long as the available
updates to the operating system are applied. However, solutions that rely on private
time zone data, or that retrieve system time zone information by accessing the registry
directly, may need to be updated. Applications that deal with historical time zone
data may also need to be updated.&lt;br&gt;
Microsoft advises all developers who make use of time zone data to test their applications
against this update to ensure that their applications function correctly.&lt;br&gt;
For more detailed information and the latest updates please visit &lt;a href="http://msdn2.microsoft.com/en-us/vstudio/bb264729.aspx"&gt;http://msdn2.microsoft.com/en-us/vstudio/bb264729.aspx&lt;/a&gt;, &lt;a href="http://support.microsoft.com/gp/cp_dst"&gt;Preparing
for daylight saving time changes in 2007&lt;/a&gt;, and &lt;a href="http://support.microsoft.com/kb/928388"&gt;KB928388:
2007 time zone update for Microsoft Windows operating systems&lt;/a&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;br&gt;
Update: I corrected all links.&lt;br&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=31e39f50-eef8-426c-a5d8-745ac00484c8" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,31e39f50-eef8-426c-a5d8-745ac00484c8.aspx</comments>
      <category>C++</category>
      <category>DotNet</category>
      <category>MFC</category>
      <category>Microsoft</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=2a9feb19-e7aa-442e-bba8-43f06b807ee8</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,2a9feb19-e7aa-442e-bba8-43f06b807ee8.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,2a9feb19-e7aa-442e-bba8-43f06b807ee8.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=2a9feb19-e7aa-442e-bba8-43f06b807ee8</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you receive the following message from visual studio 2003
</p>
        <p>
---------------------------<br />
Microsoft Development Environment<br />
---------------------------<br />
Project .vcproj' failed to open.<br />
---------------------------<br />
OK   
<br />
---------------------------
</p>
        <p>
you can open your *.vcprog file with your favorite xml editor and find the "/VisualStudioProject/References/AssemblyReference"
nodes make sure all the paths and files are valid.  One will not be, remove it
or edit the path save the file and now open it in Visual Studio.
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=2a9feb19-e7aa-442e-bba8-43f06b807ee8" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>Can't open a Visual studio 2003 project?</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,2a9feb19-e7aa-442e-bba8-43f06b807ee8.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,2a9feb19-e7aa-442e-bba8-43f06b807ee8.aspx</link>
      <pubDate>Thu, 25 Jan 2007 15:13:58 GMT</pubDate>
      <description>&lt;p&gt;
If you receive the following message from visual studio 2003
&lt;/p&gt;
&lt;p&gt;
---------------------------&lt;br&gt;
Microsoft Development Environment&lt;br&gt;
---------------------------&lt;br&gt;
Project .vcproj' failed to open.&lt;br&gt;
---------------------------&lt;br&gt;
OK&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
---------------------------
&lt;/p&gt;
&lt;p&gt;
you can open your *.vcprog file with your favorite xml editor and find the "/VisualStudioProject/References/AssemblyReference"
nodes make sure all the paths and files are valid.&amp;nbsp; One will not be, remove it
or edit the path save the file and now open it in Visual Studio.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=2a9feb19-e7aa-442e-bba8-43f06b807ee8" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,2a9feb19-e7aa-442e-bba8-43f06b807ee8.aspx</comments>
      <category>C++</category>
      <category>MFC</category>
      <category>Microsoft</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=8cd6587e-84e1-4b06-a570-18fdd3c4656e</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,8cd6587e-84e1-4b06-a570-18fdd3c4656e.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,8cd6587e-84e1-4b06-a570-18fdd3c4656e.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=8cd6587e-84e1-4b06-a570-18fdd3c4656e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Irena Kennedy posted some simple <a href="http://blogs.msdn.com/irenak/archive/2007/01/24/sysk-273-how-to-use-the-latest-version-of-visual-studio-and-build-your-project-targeting-earlier-version-of-net-framework.aspx">instructions
for compiling code for DOT NET 1.1 while using the visual studio 2005 IDE</a>. 
Unfortunately I don't think there is a way to do this with VC and MFC projects. 
How would I specify the MFC 7 rather then MFC8?  The other trouble with this
approach is all unit testing will be done on 2.0 right?
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=8cd6587e-84e1-4b06-a570-18fdd3c4656e" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>VS 2005 Build to the prior frame work</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,8cd6587e-84e1-4b06-a570-18fdd3c4656e.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,8cd6587e-84e1-4b06-a570-18fdd3c4656e.aspx</link>
      <pubDate>Wed, 24 Jan 2007 17:34:50 GMT</pubDate>
      <description>&lt;p&gt;
Irena Kennedy posted some simple &lt;a href="http://blogs.msdn.com/irenak/archive/2007/01/24/sysk-273-how-to-use-the-latest-version-of-visual-studio-and-build-your-project-targeting-earlier-version-of-net-framework.aspx"&gt;instructions
for compiling code for DOT NET 1.1 while using the visual studio 2005 IDE&lt;/a&gt;.&amp;nbsp;
Unfortunately I don't think there is a way to do this with VC and MFC projects.&amp;nbsp;
How would I specify the MFC 7 rather then MFC8?&amp;nbsp; The other trouble with this
approach is all unit testing will be done on 2.0 right?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=8cd6587e-84e1-4b06-a570-18fdd3c4656e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,8cd6587e-84e1-4b06-a570-18fdd3c4656e.aspx</comments>
      <category>DotNet</category>
      <category>MFC</category>
      <category>Microsoft</category>
      <category>Ramblings</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=afbf363e-1456-4456-b712-426a6ec27e9e</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,afbf363e-1456-4456-b712-426a6ec27e9e.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,afbf363e-1456-4456-b712-426a6ec27e9e.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=afbf363e-1456-4456-b712-426a6ec27e9e</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
As it turns out, If you define and implement your whole class/structure in a .h file
a consumer needs to mark it <font color="#0000ff">#pragma</font><font color="#000000"></font><font color="#0000ff">unmanaged</font>. 
If you don't <font color="#0000ff">delete</font> will get confused and issue the errors
i received from my earlier <a href="http://thisoldcode.microfisch.com/PermaLink,guid,6132e773-1206-4a69-975f-db1986bbd1d5.aspx">post</a>.
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=afbf363e-1456-4456-b712-426a6ec27e9e" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>VS 2005 Pain Solved!</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,afbf363e-1456-4456-b712-426a6ec27e9e.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,afbf363e-1456-4456-b712-426a6ec27e9e.aspx</link>
      <pubDate>Thu, 11 Jan 2007 19:42:05 GMT</pubDate>
      <description>&lt;p&gt;
As it turns out, If you define and implement your whole class/structure in a .h file
a consumer needs to mark it &lt;font color=#0000ff&gt;#pragma&lt;/font&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;font color=#0000ff&gt;unmanaged&lt;/font&gt;.&amp;nbsp;
If you don't &lt;font color=#0000ff&gt;delete&lt;/font&gt; will get confused and issue the errors
i received from my earlier &lt;a href="http://thisoldcode.microfisch.com/PermaLink,guid,6132e773-1206-4a69-975f-db1986bbd1d5.aspx"&gt;post&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=afbf363e-1456-4456-b712-426a6ec27e9e" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,afbf363e-1456-4456-b712-426a6ec27e9e.aspx</comments>
      <category>C++</category>
      <category>MFC</category>
      <category>Microsoft</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=41341841-dd95-4734-acdb-26cc986cd0a6</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,41341841-dd95-4734-acdb-26cc986cd0a6.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,41341841-dd95-4734-acdb-26cc986cd0a6.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=41341841-dd95-4734-acdb-26cc986cd0a6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
With one little mistake comes a nasty memory leak.  We found this in some of
the code i wrote
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CMenu*
CLMI::GetLenderMenu(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span>)<br />
{<br />
    <span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">//test
if lender should show up if not</span><br />
    <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (
!ShowLender() )<br />
        <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> NULL;<br /><br />
    CMenu* clm <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> CMenu();......</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
          </span>
          <br />
Sadly clm was never reclaimed, and MFC redraws the Main menu every time you blink
so can you say bad :(
</p>
        <img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=41341841-dd95-4734-acdb-26cc986cd0a6" />
        <br />
        <hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>This is embarrassing</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,41341841-dd95-4734-acdb-26cc986cd0a6.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,41341841-dd95-4734-acdb-26cc986cd0a6.aspx</link>
      <pubDate>Thu, 11 Jan 2007 17:07:30 GMT</pubDate>
      <description>&lt;p&gt;
With one little mistake comes a nasty memory leak.&amp;nbsp; We found this in some of
the code i wrote
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CMenu*
CLMI::GetLenderMenu(&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;void&lt;/span&gt;)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;//test
if lender should show up if not&lt;/span&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;if&lt;/span&gt; (
!ShowLender() )&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;return&lt;/span&gt; NULL;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CMenu* clm &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;=&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;new&lt;/span&gt; CMenu();......&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;/span&gt;
&lt;br&gt;
Sadly clm was never reclaimed, and MFC redraws the Main menu every time you blink
so can you say bad :(
&lt;/p&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=41341841-dd95-4734-acdb-26cc986cd0a6" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,41341841-dd95-4734-acdb-26cc986cd0a6.aspx</comments>
      <category>C++</category>
      <category>MFC</category>
      <category>My Life</category>
      <category>Ramblings</category>
    </item>
    <item>
      <trackback:ping>http://thisoldcode.net/Trackback.aspx?guid=6132e773-1206-4a69-975f-db1986bbd1d5</trackback:ping>
      <pingback:server>http://thisoldcode.net/pingback.aspx</pingback:server>
      <pingback:target>http://thisoldcode.net/PermaLink,guid,6132e773-1206-4a69-975f-db1986bbd1d5.aspx</pingback:target>
      <dc:creator>Aaron Fischer</dc:creator>
      <wfw:comment>http://thisoldcode.net/CommentView,guid,6132e773-1206-4a69-975f-db1986bbd1d5.aspx</wfw:comment>
      <wfw:commentRss>http://thisoldcode.net/SyndicationService.asmx/GetEntryCommentsRss?guid=6132e773-1206-4a69-975f-db1986bbd1d5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is interesting, I am moving a vc++ project to VS 2005.  When i run it in
debug mode i receive this error: 
</p>
        <blockquote>
          <p>
          </p>
          <p>
---------------------------<br />
Microsoft Visual C++ Debug Library<br />
---------------------------<br />
Debug Assertion Failed!
</p>
          <p>
Program: c:\Dev\Point\PointMain\Debug\Winpoint.exe<br />
File: dbgdel.cpp<br />
Line: 52
</p>
          <p>
Expression: _BLOCK_TYPE_IS_VALID(pHead-&gt;nBlockUse)
</p>
          <p>
For information on how your program can cause an assertion<br />
failure, see the Visual C++ documentation on asserts.
</p>
        </blockquote>
        <br />
This I can trace back to the call to delete in this function:<br /><p><span style="font-size: 11px; color: black; font-family: Courier New; background-color: transparent;">    <span style="font-size: 11px; color: blue; font-family: Courier New; background-color: transparent;">void</span> RemoveIt(CDlgAncItem*
item) 
<br />
    {<br />
        <span style="font-size: 11px; color: blue; font-family: Courier New; background-color: transparent;">if</span> (item) 
<br />
        {<br />
            RemoveIt(item-&gt;next);<br />
            delete(item);<br />
        }<br />
    }</span></p>
The CDlgAncItem is a class it has a destructor and a copy constructor. 
I am not sure why the debugger is losing track of the memory, Its a pretty simple
data structure stored in a dynamically allocated link list. 
<br />
Edit: I found a <a href="http://thisoldcode.microfisch.com/PermaLink,guid,afbf363e-1456-4456-b712-426a6ec27e9e.aspx">solution</a>.<br /><img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=6132e773-1206-4a69-975f-db1986bbd1d5" /><br /><hr />
This weblog is sponsored by <a href="http://www.MicroFisch.com">MicroFisch</a>.</body>
      <title>VS 2005 pains</title>
      <guid isPermaLink="false">http://thisoldcode.net/PermaLink,guid,6132e773-1206-4a69-975f-db1986bbd1d5.aspx</guid>
      <link>http://thisoldcode.net/PermaLink,guid,6132e773-1206-4a69-975f-db1986bbd1d5.aspx</link>
      <pubDate>Thu, 11 Jan 2007 15:15:35 GMT</pubDate>
      <description>&lt;p&gt;
This is interesting, I am moving a vc++ project to VS 2005.&amp;nbsp; When i run it in
debug mode i receive this error: 
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
---------------------------&lt;br&gt;
Microsoft Visual C++ Debug Library&lt;br&gt;
---------------------------&lt;br&gt;
Debug Assertion Failed!
&lt;/p&gt;
&lt;p&gt;
Program: c:\Dev\Point\PointMain\Debug\Winpoint.exe&lt;br&gt;
File: dbgdel.cpp&lt;br&gt;
Line: 52
&lt;/p&gt;
&lt;p&gt;
Expression: _BLOCK_TYPE_IS_VALID(pHead-&amp;gt;nBlockUse)
&lt;/p&gt;
&lt;p&gt;
For information on how your program can cause an assertion&lt;br&gt;
failure, see the Visual C++ documentation on asserts.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;br&gt;
This I can trace back to the call to delete in this function:&lt;br&gt;
&lt;p&gt;
&lt;span style="font-size: 11px; color: black; font-family: Courier New; background-color: transparent;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="font-size: 11px; color: blue; font-family: Courier New; background-color: transparent;"&gt;void&lt;/span&gt; RemoveIt(CDlgAncItem*
item) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="font-size: 11px; color: blue; font-family: Courier New; background-color: transparent;"&gt;if&lt;/span&gt; (item) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RemoveIt(item-&amp;gt;next);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delete(item);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;
&lt;/p&gt;
The CDlgAncItem is a class it has a destructor&amp;nbsp;and a copy constructor.&amp;nbsp;
I am not sure why the debugger is losing track of the memory, Its a pretty simple
data structure stored in a dynamically allocated link list. 
&lt;br&gt;
Edit: I found a &lt;a href="http://thisoldcode.microfisch.com/PermaLink,guid,afbf363e-1456-4456-b712-426a6ec27e9e.aspx"&gt;solution&lt;/a&gt;.&lt;br&gt;
&lt;img width="0" height="0" src="http://thisoldcode.net/aggbug.ashx?id=6132e773-1206-4a69-975f-db1986bbd1d5" /&gt;
&lt;br /&gt;
&lt;hr /&gt;
This weblog is sponsored by &lt;a href="http://www.MicroFisch.com"&gt;MicroFisch&lt;/a&gt;.</description>
      <comments>http://thisoldcode.net/CommentView,guid,6132e773-1206-4a69-975f-db1986bbd1d5.aspx</comments>
      <category>C++</category>
      <category>MFC</category>
    </item>
  </channel>
</rss>