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

<channel>
	<title>Code Library &#187; Visual Studio</title>
	<atom:link href="http://www.ucosoft.com/tag/visual-studio/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ucosoft.com</link>
	<description>Free Source Code and Program Tips</description>
	<lastBuildDate>Thu, 22 Jul 2010 05:17:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CComModule in porting ATL DLL project to VC8</title>
		<link>http://www.ucosoft.com/ccommodule-in-porting-atl-dll-project-to-vc8.html</link>
		<comments>http://www.ucosoft.com/ccommodule-in-porting-atl-dll-project-to-vc8.html#comments</comments>
		<pubDate>Fri, 22 Jun 2007 01:33:15 +0000</pubDate>
		<dc:creator>support</dc:creator>
				<category><![CDATA[Win32/MFC]]></category>
		<category><![CDATA[ATL]]></category>
		<category><![CDATA[dll]]></category>
		<category><![CDATA[MS-KB]]></category>
		<category><![CDATA[VC6]]></category>
		<category><![CDATA[VC8]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/2007/06/22/ccommodule-in-migrating-atl-dll-project-to-vc8.html</guid>
		<description><![CDATA[When migrating an ATL project from vc6 to vc8, you will get a problem about CComModule. Problem: In vc6, there is such a declaration in stdafx.h as: extern CComModule _Module; and in the main module: CComModule _Module; But when you complie it in vc8, the following errors apears: c:\temp\myatl\stdafx.h(24) : error C2146: syntax error : [...]]]></description>
			<content:encoded><![CDATA[<p>When migrating an ATL project from vc6 to vc8, you will get a problem about CComModule.</p>
<p><strong>Problem</strong>:</p>
<p>In vc6, there is such a declaration in stdafx.h as:<br />
<coolcode lang="cpp" linenum="no">extern CComModule _Module;</coolcode></p>
<p>and in the main module:</p>
<p><coolcode lang="cpp" linenum="no">CComModule _Module; </coolcode></p>
<p>But when you complie it in vc8, the following errors apears:<br />
<coolcode lang="cpp" linenum="no"><br />
c:\temp\myatl\stdafx.h(24) : error C2146: syntax error : missing &#8216;;&#8217; before identifier &#8216;_Module&#8217;<br />
c:\temp\myatl\stdafx.h(24) : error C4430: missing type specifier &#8211; int assumed. Note: C++ does not support default-int<br />
c:\temp\myatl\stdafx.h(24) : error C4430: missing type specifier &#8211; int assumed. Note: C++ does not support default-int<br />
</coolcode></p>
<p><strong>Solution</strong>:</p>
<p>In ATL 7.0, which is the ATL version that is included in Visual C++ .NET and in Visual C++ 2005, the <strong>CAtlBaseModule</strong> class has replaced the obsolete <strong>CComModule</strong> class.</p>
<p>Microsoft has given the solution in KB309705 &#8211; &#8220;_AtlBaseModule.m_hInst replaces _Module.m_hInst in ATL 7.0&#8243; </p>
<p><a href="http://support.microsoft.com/kb/309705/ ">http://support.microsoft.com/kb/309705/ </a></p>

	Tags: <strong><a href="http://www.ucosoft.com/tag/atl" title="ATL" rel="tag">ATL</a>, <a href="http://www.ucosoft.com/tag/dll" title="dll" rel="tag">dll</a>, <a href="http://www.ucosoft.com/tag/ms-kb" title="MS-KB" rel="tag">MS-KB</a>, <a href="http://www.ucosoft.com/tag/vc6" title="VC6" rel="tag">VC6</a>, <a href="http://www.ucosoft.com/tag/vc8" title="VC8" rel="tag">VC8</a>, <a href="http://www.ucosoft.com/tag/visual-studio" title="Visual Studio" rel="tag">Visual Studio</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/ccommodule-in-porting-atl-dll-project-to-vc8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable &#8220;profile&#8221; in Visual C++ 6.0</title>
		<link>http://www.ucosoft.com/how-to-enable-profile-in-vc-6.html</link>
		<comments>http://www.ucosoft.com/how-to-enable-profile-in-vc-6.html#comments</comments>
		<pubDate>Thu, 28 Dec 2006 11:11:52 +0000</pubDate>
		<dc:creator>support</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/archives/68.html</guid>
		<description><![CDATA[From MSDN: The profiler is an analysis tool that you can use to examine the run-time behavior of your programs. By using profiler information, you can determine which sections of your code are working efficiently. The profiler can produce information showing areas of code that are not being executed or that are taking a long [...]]]></description>
			<content:encoded><![CDATA[<p><P><br />
<I>From MSDN</I>:<br />
The profiler is an analysis tool that you can use to examine the run-time behavior of your programs. By using profiler information, you can determine which sections of your code are working efficiently. The profiler can produce information showing areas of code that are not being executed or that are taking a long time to execute.</p>
<p>But in Visual C++ 6.0, you often found that the <strong>profile</strong> menu item is grayed. How to enable it?</p>
<p>To enable profile in VC 6.0, you first need to set the correct link parameter, and rebuild all the project.</P><br />
<coolcode linenum="no"><br />
Project|Setting|Link<br />
Enable profiling<br />
</coolcode><br />
<P><br />
Wait a minute, do you find that the profile menu item is still grayed?<br />
OK. It&#8217;s because that you installed vc6 with one account but use it with another one. It&#8217;s mayby a bug of VC6.<br />
But how can you to correct it? It&#8217;s easy. Just modify the entry value in the registery<span id="more-68"></span>.<br />
<coolcode lang="cpp" linenum="no"><br />
[HKEY_CURRENT_USER\Software\Microsoft\Devstudio\6.0\General]<br />
&#8220;ProfilerInstalled&#8221;=dword:00000001<br />
</coolcode></p>

	Tags: <strong><a href="http://www.ucosoft.com/tag/profile" title="profile" rel="tag">profile</a>, <a href="http://www.ucosoft.com/tag/tips" title="Tips" rel="tag">Tips</a>, <a href="http://www.ucosoft.com/tag/visual-studio" title="Visual Studio" rel="tag">Visual Studio</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/how-to-enable-profile-in-vc-6.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make the Code Completion working again in VC++ 6.0</title>
		<link>http://www.ucosoft.com/make-the-code-completion-working-again-in-vc-60.html</link>
		<comments>http://www.ucosoft.com/make-the-code-completion-working-again-in-vc-60.html#comments</comments>
		<pubDate>Thu, 07 Dec 2006 00:59:10 +0000</pubDate>
		<dc:creator>hamo</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/archives/55.html</guid>
		<description><![CDATA[Code Completion is a very useful feature&#160;of programiing, but&#160;it often &#160;strikes in VC++ 6.0. If you meet such matter, try the following step: 1. delete *.ncb, *.opt, *.plg and *.clw files from your project directory 2. rebuild your project. And you often need CTRL+W to generate the class wizard infmation again. But the above works [...]]]></description>
			<content:encoded><![CDATA[<p>Code Completion is a very useful feature&nbsp;of programiing, but&nbsp;it often &nbsp;strikes in VC++ 6.0. If you meet such matter, try the following step:</p>
<p><!--adsense--><br />
<coolcode linenum="no"><br />
1. delete *.ncb, *.opt, *.plg and *.clw files from your project directory<br />
2. rebuild your project.<br />
</coolcode> </p>
<p>And you often need CTRL+W to generate the class wizard infmation again.</p>
<p>But the above works quite often but not always. For a better experience, you need to try some comercial tools, for example, <a href="http://www.wholetomato.com/" rel="nofollow">Visual Assistant</a>.It is a product of <a href="http://www.wholetomato.com/" rel="nofollow">Whold Tomato Software</a> and&nbsp; provides more powerful functions.</p>

	Tags: <strong><a href="http://www.ucosoft.com/tag/tips" title="Tips" rel="tag">Tips</a>, <a href="http://www.ucosoft.com/tag/visual-studio" title="Visual Studio" rel="tag">Visual Studio</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/make-the-code-completion-working-again-in-vc-60.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some useful shortcut of Visual Studio 6</title>
		<link>http://www.ucosoft.com/some-useful-shortcut-of-visual-studio-6.html</link>
		<comments>http://www.ucosoft.com/some-useful-shortcut-of-visual-studio-6.html#comments</comments>
		<pubDate>Fri, 01 Dec 2006 03:41:09 +0000</pubDate>
		<dc:creator>support</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/archives/47.html</guid>
		<description><![CDATA[Hide/Show white spaces: Ctrl+Shift+8 Column Selection Alt+Mouse SelectLine Ctrl+F8 LineCut Ctrl+L LineDelete Ctrl+Shift+L Virtual Space menu: Options->Compatibility->Enable virtual space Browse Navigate: GotoMatchBraceExtend Ctrl+] Browse Navigate: MatchBrace Selection Ctrl+Shift+] Browse Navigate: ConditionUp/Down Ctrl+J Ctrl+K Browse Navigate: Condition Selection Ctrl+Shift+J Ctrl+Shift+K Browse Navigate: ErrorTags(Next/Previous) F4 / Shift+F4 Bookmarks: temp bookmark: Ctrl+F2 Bookmarks: named bookmark Ctrl+Shift+J Ctrl+Shift+K Bookmarks: [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>Hide/Show white spaces:</li>
</ul>
<p><coolcode linenum="no">Ctrl+Shift+8</coolcode></p>
<ul>
<li>Column Selection</li>
</ul>
<p><coolcode linenum="no">Alt+Mouse</coolcode></p>
<ul>
<li>SelectLine</li>
</ul>
<p><coolcode linenum="no">Ctrl+F8</coolcode></p>
<ul>
<li>LineCut</li>
</ul>
<p><coolcode linenum="no">Ctrl+L</coolcode></p>
<ul>
<li>LineDelete</li>
</ul>
<p><coolcode linenum="no">Ctrl+Shift+L</coolcode><br />
<span id="more-47"></span></p>
<ul>
<li>Virtual Space</li>
</ul>
<p><coolcode linenum="no"><br />
menu: Options->Compatibility->Enable virtual space<br />
</coolcode></p>
<ul>
<li>Browse Navigate: GotoMatchBraceExtend</li>
</ul>
<p><coolcode linenum="no">Ctrl+]</coolcode></p>
<ul>
<li>Browse Navigate: MatchBrace Selection</li>
</ul>
<p><coolcode linenum="no">Ctrl+Shift+]</coolcode></p>
<ul>
<li>Browse Navigate: ConditionUp/Down</li>
</ul>
<p><coolcode linenum="no">Ctrl+J   Ctrl+K</coolcode></p>
<ul>
<li>Browse Navigate: Condition Selection</li>
</ul>
<p><coolcode linenum="no">Ctrl+Shift+J  Ctrl+Shift+K</coolcode></p>
<ul>
<li>Browse Navigate: ErrorTags(Next/Previous)</li>
</ul>
<p><coolcode linenum="no">F4 / Shift+F4</coolcode></p>
<ul>
<li>Bookmarks: temp bookmark:</li>
</ul>
<p><coolcode linenum="no">Ctrl+F2</coolcode></p>
<ul>
<li>Bookmarks: named bookmark</li>
</ul>
<p><coolcode linenum="no">Ctrl+Shift+J  Ctrl+Shift+K</coolcode></p>
<ul>
<li>Bookmarks: Next/Previous</li>
</ul>
<p><coolcode linenum="no">F2 /Shift+F2</coolcode></p>
<ul>
<li>Code complete: global function</li>
</ul>
<p><coolcode linenum="no">Ctrl+Alt+T</coolcode></p>
<ul>
<li>Code complete: switch between overloaded function</li>
</ul>
<p><coolcode linenum="no">Ctrl+PageDown /Ctrl+PageUp</coolcode></p>
<ul>
<li>Code complete: show tip</li>
</ul>
<p><coolcode linenum="no">Ctrl+Shift+Space</coolcode></p>
<ul>
<li>Code complete: complete word</li>
</ul>
<p><coolcode linenum="no">Ctrl+Spache</coolcode></p>
<p><!--adsense--></p>

	Tags: <strong><a href="http://www.ucosoft.com/tag/tips" title="Tips" rel="tag">Tips</a>, <a href="http://www.ucosoft.com/tag/visual-studio" title="Visual Studio" rel="tag">Visual Studio</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/some-useful-shortcut-of-visual-studio-6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some comment about Visual SourceSafe</title>
		<link>http://www.ucosoft.com/visual-sourcesafe-microsofts-source-destruction-system.html</link>
		<comments>http://www.ucosoft.com/visual-sourcesafe-microsofts-source-destruction-system.html#comments</comments>
		<pubDate>Wed, 22 Nov 2006 06:24:55 +0000</pubDate>
		<dc:creator>hamo</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Source Control]]></category>
		<category><![CDATA[SourceSafe]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/archives/23.html</guid>
		<description><![CDATA[Here is the short introduction of the great article of&#160; Alan De&#160;Smet . Please goto the author&#8217;s website for the fulltext and there are some upgrade of the article. The author introduced the shortcomings of SourceSafe and hoped&#160; to dissuade us from using SourceSafe, and have spared us the bad experiences he had. Alan De&#160;Smet [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Here is the short introduction of the great article of&nbsp; <a href="http://www.highprogrammer.com/alan/">Alan De&nbsp;Smet </a>. Please goto the <a href="http://www.highprogrammer.com/alan/windev/sourcesafe.html ">author&#8217;s website</a> for the fulltext and there are some upgrade of the article.</strong></p>
<p>The author introduced the shortcomings of SourceSafe and hoped&nbsp; to dissuade us from using SourceSafe, and have spared us the bad experiences he had.<span id="more-23"></span></p>
<p><strong> <a href="http://www.highprogrammer.com/alan/">Alan De&nbsp;Smet</a></strong> provided the missing features of the Micosoft SourceSafe:</p>
<ul>
<li>SourceSafe lacks usable branching support</li>
<li>SourceSafe cannot be safely extended</li>
<li>SourceSafe silently leaves stale files on your local system</li>
<li>SourceSafe badly handles slow networks and the public internet</li>
<li>Managing third party modules is difficult with SourceSafe</li>
<li>Viewing and retrieving historical versions is extremely slow</li>
<li>Difficult to maintain multiple local copies of one project</li>
</ul>
<p> <strong><a href="http://www.highprogrammer.com/alan/">Alan De&nbsp;Smet</a></strong> also thought that the safety of SourceSafe was bad.<strong><br /></strong></p>
<ul>
<li>SourceSafe degrades on large projects</li>
<li>SourceSafe integration can crash Visual Studio</li>
<li>SourceSafe relies on dangerous file sharing</li>
<li>SourceSafe should be scanned for corruption weekly</li>
<li>SourceSafe handles multiple time zones badly</li>
<li>SourceSafe becomes corrupted</li>
</ul>
<p>And at last, <strong><a href="http://www.highprogrammer.com/alan/">Alan De&nbsp;Smet</a>&nbsp; </strong>suggested us to transfer our souce control system to some better choice. </p>
<p><strong>The original fulltext is <a href="http://www.highprogrammer.com/alan/windev/sourcesafe.html">here</a>. &nbsp;</strong><strong> <a href="http://www.highprogrammer.com/alan/"><br /></a></strong></p>

	Tags: <strong><a href="http://www.ucosoft.com/tag/source-control" title="Source Control" rel="tag">Source Control</a>, <a href="http://www.ucosoft.com/tag/sourcesafe" title="SourceSafe" rel="tag">SourceSafe</a>, <a href="http://www.ucosoft.com/tag/tips" title="Tips" rel="tag">Tips</a>, <a href="http://www.ucosoft.com/tag/visual-studio" title="Visual Studio" rel="tag">Visual Studio</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/visual-sourcesafe-microsofts-source-destruction-system.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Visual C++ Tips</title>
		<link>http://www.ucosoft.com/microsoft-visual-c-tips-and-tricks2.html</link>
		<comments>http://www.ucosoft.com/microsoft-visual-c-tips-and-tricks2.html#comments</comments>
		<pubDate>Wed, 22 Nov 2006 06:12:20 +0000</pubDate>
		<dc:creator>hamo</dc:creator>
				<category><![CDATA[Win32/MFC]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/archives/21.html</guid>
		<description><![CDATA[Here are some tips of Microsoft Visual Studio 6.0. Display the LastError&#8217;s value When we want to get the LastError message, we often using the following code. LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER &#124; FORMAT_MESSAGE_FROM_SYSTEM &#124; FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &#038;lpMsgBuf, 0, NULL ); // Process any inserts in lpMsgBuf. // &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some tips of Microsoft Visual Studio 6.0.</p>
<h4><a href="#" rel="bookmark">Display the LastError&#8217;s value</A></h4>
<p>When we want to get the LastError message, we often using the following code.</p>
<p><coolcode lang="cpp" linenum="no"><br />
LPVOID lpMsgBuf;<br />
FormatMessage(<br />
    FORMAT_MESSAGE_ALLOCATE_BUFFER |<br />
    FORMAT_MESSAGE_FROM_SYSTEM |<br />
    FORMAT_MESSAGE_IGNORE_INSERTS,<br />
    NULL,<br />
    GetLastError(),<br />
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language<br />
    (LPTSTR) &#038;lpMsgBuf,<br />
    0,<br />
    NULL<br />
);<br />
// Process any inserts in lpMsgBuf.<br />
// &#8230;<br />
// Display the string.<br />
MessageBox( NULL, (LPCTSTR)lpMsgBuf, &#8220;Error&#8221;, MB_OK | MB_ICONINFORMATION );<br />
// Free the buffer.<br />
LocalFree( lpMsgBuf );<br />
</coolcode><br />
<br />But now VisualSudio 6.0 has provied a virtual Pseudoregister called <coolcode linenum="no">@ERR</coolcode><br />
we can simply input the expression in the watch window and we will get the LastError message.<coolcode linenum="no">@ERR,hr</coolcode>Here is supported pseudoregisters list:<a href="http://www.codeproject.com/debug/pseudoregister.asp">[1]</a><br />
<span id="more-21"></span><br />
<coolcode lang="asm" linenum="no"><br />
@ERR<br />
;Last error value,the same value returned by the GetLastError() API function</p>
<p>@TIB<br />
;Thread information block for the current thread</p>
<p>@CLK<br />
;Undocumented clock register; usable only in the Watch window</p>
<p>@EAX, @EBX, @ECX, @EDX, @ESI, @EDI, @EIP, @ESP, @EBP, @EFL<br />
;Intel CPU registers</p>
<p>@CS, @DS, @ES, @SS, @FS, @GS<br />
;Intel CPU segment registers</p>
<p>@ST0, @ST1, @ST2, @ST3, @ST4, @ST5, @ST6, @ST7<br />
;Intel CPU floating-point registers<br />
</coolcode></p>
<h4><a href="#" rel="bookmark">Acknowledge:</a></h4>
<p><!--adsense--><br />
[1]<a href="http://www.codeproject.com/debug/pseudoregister.asp">An introduction to debugging in MSVC++ using Pseudoregisters </a><br /> <br />
[2]<a href="http://www.highprogrammer.com/alan/windev/visualstudio.html">Microsoft Visual C++ Tips and Tricks </a></p>

	Tags: <strong><a href="http://www.ucosoft.com/tag/debug" title="Debug" rel="tag">Debug</a>, <a href="http://www.ucosoft.com/tag/visual-studio" title="Visual Studio" rel="tag">Visual Studio</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/microsoft-visual-c-tips-and-tricks2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

