<?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"
	>

<channel>
	<title>Fooling Around</title>
	<atom:link href="http://alax.info/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://alax.info/blog</link>
	<description>Software Production Line</description>
	<pubDate>Thu, 02 Oct 2008 20:00:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Sticky: Blog Navigation</title>
		<link>http://alax.info/blog/200</link>
		<comments>http://alax.info/blog/200#comments</comments>
		<pubDate>Sun, 06 Apr 2008 08:00:01 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[faq]]></category>

		<guid isPermaLink="false">http://alax.info/blog/200</guid>
		<description><![CDATA[
Did you come here for some cool software or an utility?

Software: check NTFS Links, DHCP Server pages
WordPress Plugins: check Google Talk Sidebar Widget pages
Utilities: check Utilities category and check subcategories on the sidebar


Are you interested in C++ development, ATL and WTL?

Check Technology category, ATL and WTL subcategories, you might also be interested in Source Code





]]></description>
			<content:encoded><![CDATA[<div class="announcement_post"><ol>
<li>Did you come here for some cool software or an utility?
<ul>
<li>Software: check <a href="http://alax.info/blog/ntfslinks/">NTFS Links</a>, <a title="Alax.Info DHCP Server" href="http://alax.info/blog/dhcp-server">DHCP Server</a> pages</li>
<li>WordPress Plugins: check <a href="http://alax.info/blog/tag/wp-googletalk">Google Talk Sidebar Widget</a> pages</li>
<li>Utilities: check <a href="http://alax.info/blog/category/utilities/">Utilities</a> category and check subcategories on the sidebar</li>
</ul>
</li>
<li>Are you interested in C++ development, ATL and WTL?
<ul>
<li>Check <a href="http://alax.info/blog/category/technology/">Technology</a> category, <a href="http://alax.info/blog/category/technology/atl/">ATL</a> and <a href="http://alax.info/blog/category/technology/wtl/">WTL</a> subcategories, you might also be interested in <a href="http://alax.info/blog/category/source/">Source Code<br />
</a></li>
</ul>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/200/feed</wfw:commentRss>
		</item>
		<item>
		<title>/GS Buffer Security Check</title>
		<link>http://alax.info/blog/656</link>
		<comments>http://alax.info/blog/656#comments</comments>
		<pubDate>Mon, 29 Sep 2008 13:38:39 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[ATL]]></category>

		<category><![CDATA[Seriously]]></category>

		<category><![CDATA[c++]]></category>

		<category><![CDATA[compiler]]></category>

		<category><![CDATA[crt]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=656</guid>
		<description><![CDATA[Microsoft C++ compiler offers a buffer security check option since quite a long ago. It adds so called &#8220;security cookies&#8221; onto stack and checks them to be not modified by code in order to early-detect stack buffer overflow conditions. The compiler option /GS is enabled by default in Release configurations and is not applicable to [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>Microsoft C++ compiler offers a buffer security check option since quite a long ago. It adds so called &#8220;security cookies&#8221; onto stack and checks them to be not modified by code in order to early-detect stack buffer overflow conditions. <a href="http://msdn.microsoft.com/en-us/library/8dbf701c.aspx">The compiler option /GS</a> is enabled by default in Release configurations and is not applicable to debug code (which has optimizations disabled).</p>
<p>Here comes the trouble: release code might show unexpected message box &#8220;Buffer overrun detected!&#8221;. I have never seen such after years of development and tens of thousands of lines of code written, but luckily there are colleagues who can contribute a challenging issue to investigate.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2008/09/29-image001.png"><img class="alignnone size-medium wp-image-657" title="Buffer overrun detected!" src="http://alax.info/blog/wp-content/uploads/2008/09/29-image001-300x128.png" alt="" width="300" height="128" /></a></p>
<p>The message is shown through C runtime&#8217;s __crtMessageBoxA function and is not only annoying and angering the customer, it also stops application operation and terminates it:</p>
<blockquote><p>By default, an application that fails a security check displays a dialog box that states &#8220;Buffer overrun detected!&#8221; When the dialog box is closed, the application terminates.</p></blockquote>
<p>However it is possible to override this behavior:</p>
<blockquote><p>The CRT library offers the developer an option to use a different handler that would react to the buffer overrun in a manner more sensible to the application. The function, <strong>__set_security_error_handler</strong>, is used to install the user handler by storing the user-defined handler in the <em>user_handler</em> variable</p></blockquote>
<p>In my case we would be overriding this to trace call stack at the issue point. However, let us see first what other conditions might cause a message box. CRT source has the following occurrences for__crtMessageBoxA:</p>
<ul>
<li>assert.c - assertion failure, which normally only applies to debug code</li>
<li>crt0msg.c - _NMSG_WRITE function, typically for a fatal run time error messages</li>
<li>crtlib.c - _CRTDLL_INIT fails to start on a Win32s system (VER_PLATFORM_WIN32s)</li>
<li>crtmbox.c - implementation of __crtMessageBoxA (which is, among other things binds to API functions on runtime instead of static linking)</li>
<li>dbgrpt.c - CrtMessageWindow function, applies to debug code only</li>
<li>secfail.c - __security_error_handler function, the /GS thing</li>
</ul>
<p>So it appears that hopefully /GS failure is the only surprising condition to display an unexpected message box.</p>
<p>OK, let us just see what we got finally here. Using the MSDN sample code and overriding default check failure handler:</p>
<pre>int main()
{
	_set_security_error_handler(report_failure); // &lt;&lt;---------------- Override
	// declare buffer that is bigger than expected
	char large_buffer[] = "This string is longer than 10 characters!!";
	vulnerable(large_buffer);
}</pre>
<p>Private handler is:</p>
<pre>void __cdecl report_failure(int code, void*)
{
	ATLTRACE2(atlTraceGeneral, 0, _T("Security Error Handler: Code %d\n"), code);
	CONTEXT Context = { CONTEXT_CONTROL };
	if(GetCurrentThreadContext(&amp;Context))
		CDebugTraceCallStack::TraceCallStack(Context);
}</pre>
<p>and finally output:</p>
<pre>BufferSecurityCheckSample.cpp(20): report_failure: Security Error Handler: Code 1
  BufferSecurityCheckSample!0x00402a2d report_failure (+ 125) [c:\buffersecuritychecksample\buffersecuritychecksample.cpp, 22] (+ 10) @00400000
  BufferSecurityCheckSample!0x00403d56 __security_error_handler (+ 48) [f:\vs70builds\6030\vc\crtbld\crt\src\secfail.c, 79] (+ 6) @00400000
  BufferSecurityCheckSample!0x00402e1d report_failure (+ 25) [f:\vs70builds\6030\vc\crtbld\crt\src\secchk.c, 117] (+ 9) @00400000
<span style="color: #ff0000;"><strong>  BufferSecurityCheckSample!0x0040142c vulnerable (+ 44) [c:\buffersecuritychecksample\buffersecuritychecksample.cpp, 36] (+ 11) @00400000
</strong></span>  BufferSecurityCheckSample!0x00404019 mainCRTStartup (+ 371) [f:\vs70builds\6030\vc\crtbld\crt\src\crt0.c, 259] (+ 18) @00400000
  kernel32!0x7c817067 RegisterWaitForInputIdle (+ 73) @7c800000</pre>
<p>The log file would immediately show the source of the run time problem.</p>
<p>See Also:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/8dbf701c.aspx">/GS (Buffer Security Check)</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/aa290051.aspx">Compiler Security Checks In Depth</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/656/feed</wfw:commentRss>
		</item>
		<item>
		<title>Microsoft Visual Studio .NET 2008 SP1 IDE bugs continued</title>
		<link>http://alax.info/blog/653</link>
		<comments>http://alax.info/blog/653#comments</comments>
		<pubDate>Wed, 24 Sep 2008 15:28:46 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Seriously]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=653</guid>
		<description><![CDATA[It is amazing how bugs go through versions and years. Visual Studio&#8217;s IDE dockable windows framework is cool, no doubt. But it was since 2005, if not earlier, that tool window undocked by a double click while application is running (debugging session active) is brought to wrong position and is tending to go out of [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>It is amazing how bugs go through versions and years. Visual Studio&#8217;s IDE dockable windows framework is cool, no doubt. But it was since 2005, if not earlier, that tool window undocked by a double click while application is running (debugging session active) is brought to wrong position and is tending to go out of screen area being re-shown.</p>
<p>This is exactly the behavior in 2008 version, regardless of reworked framework and fancy icons/hints/placeholders for the window being dragged. But just now it was even better. I double clicked &#8220;Find Results 1&#8243; window to maximize the window&#8230; and it disappeared. After looking for it through menu and other GUI elements, I finally found it at the rightmost border of the secondary monitor:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2008/09/24-image012.png"><img class="alignnone size-medium wp-image-654" title="MS VS 2008 SP1 IDE" src="http://alax.info/blog/wp-content/uploads/2008/09/24-image012-300x252.png" alt="" width="300" height="252" /></a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/653/feed</wfw:commentRss>
		</item>
		<item>
		<title>Security Essen 2008</title>
		<link>http://alax.info/blog/648</link>
		<comments>http://alax.info/blog/648#comments</comments>
		<pubDate>Wed, 24 Sep 2008 07:56:57 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Seriously]]></category>

		<category><![CDATA[classified]]></category>

		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=648</guid>
		<description><![CDATA[Security Essen 2008 is a global event for securty industry. The website lists exhibitors, but I would rather it is more usable in sense of listing and filtering exhibitors. Luckily, the list is parsed out for a better manipulation:

And also a product category filtering:

A categorized list of over 1000 exhibitors with addresses and public contact [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>Security Essen 2008 is a global event for securty industry. <a href="http://www.security-messe.de/">The website</a> lists exhibitors, but I would rather it is more usable in sense of listing and filtering <a href="http://www.security-messe.de/index.php?mp_action=showlist&amp;lang=en&amp;content=90000000">exhibitors</a>. Luckily, the list is parsed out for a better manipulation:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2008/09/24-image002.png"><img class="alignnone size-medium wp-image-650" title="Exhibitors" src="http://alax.info/blog/wp-content/uploads/2008/09/24-image002-300x178.png" alt="" width="300" height="178" /></a></p>
<p>And also a product category filtering:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2008/09/24-image001.png"><img class="alignnone size-medium wp-image-649" title="Exhibitor Product Groups" src="http://alax.info/blog/wp-content/uploads/2008/09/24-image001-300x90.png" alt="" width="300" height="90" /></a></p>
<p>A categorized list of <strong>over 1000 exhibitors</strong> with addresses and public contact information is <a href="http://alax.info/blog/about">available</a> as <a href="http://openoffice.org/">Open Office</a> ODS and <a href="http://office.microsoft.com/">Microsoft Excel</a> XLS spreadsheets, as well as CSV formatted text.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/648/feed</wfw:commentRss>
		</item>
		<item>
		<title>Microsoft Visual Studio .NET Development Environment</title>
		<link>http://alax.info/blog/646</link>
		<comments>http://alax.info/blog/646#comments</comments>
		<pubDate>Mon, 15 Sep 2008 06:50:42 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Seriously]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[Video]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[stupidity]]></category>

		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=646</guid>
		<description><![CDATA[The other day I &#8220;wrote some code&#8221; to workaround an extremely stupid hardware issues. The depth of idiocy is just incredible: to release a bunch of hardware that just don&#8217;t work, release a number of firmware updates that just don&#8217;t fix the simplest thing: HTTP compatibility. If there was a single little try to see [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>The other day I &#8220;wrote some code&#8221; to workaround an extremely stupid hardware issues. The depth of idiocy is just incredible: to release a bunch of hardware that just don&#8217;t work, release a number of firmware updates that just don&#8217;t fix the simplest thing: HTTP compatibility. If there was a single little try to see how this piece of crap comminicates with any WinHTTP based application, an error 12152 ERROR_WINHTTP_INVALID_SERVER_RESPONSE on the first second of execution would imminently come up and demonstrate that someone has to be fired without any hesitation.</p>
<p>Things, however, definitely went a different way with hardware still on the shelves and no firmware upgrades available on the website. Our customer got into trouble having already recommended his customer the buggy thing in amount of X and forwarded us the question of getting everything working. As we decided to make a step towards, I needed to &#8220;write some code&#8221; to settle the problem.</p>
<p>However, the story was about a different thing. So in order to put a comment into code that explains what kind of problem we are dealing with, I copy/pasted a fragment of HTTP request/response content from <a href="http://www.wireshark.org/">Wireshark</a> into source file being edited within MS Visual Studio .NET IDE. Wireshark copies text with some weird line endings, I knew that. I removed extra empty lines from pasted text and actually did not expect anything to go wrong. However who appeared to be wrong was me.</p>
<p>Initially there seemed to be no problem, I tried to compile code, fixed some compiler errors, even started application. I was somewhat confused that the application did not hit my breakpoint while it should. Then I noticed it did not even generate code for this line. As these things do happen with development environment, I re-opened IDE, deleting .NCB for the project and Rebuilt All. The problem however did not go.  After further code modification, the compiler started giving errors and shown wrong lines in build output, which did not match source code line numbers.</p>
<p>This started being completely stupid: I was to look at wrong identifier, search through entire source file for occurrences, see if this particular occurrence might be actually a problem for compiler and so on. I made it compiled successffully but under debugger there were still wrong line numbers which made it impossible to debug and set breakpoints.</p>
<p>At this point I remembered Wireshark and line endings. Just removing the comments did not worked. And since visually everything was OK with the source, there should be an easy way found to normalize text. And what I did was the following: I started new message in <a href="http://en.wikipedia.org/wiki/Mozilla_Thunderbird">Mozilla Thunderbird</a> and copy/pasted entire source file content into Thunderbird&#8217;s editor. Then copy/pasted back into Visual Studio and finally got the things fixed.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/646/feed</wfw:commentRss>
		</item>
		<item>
		<title>Microsoft Forums, RSS</title>
		<link>http://alax.info/blog/642</link>
		<comments>http://alax.info/blog/642#comments</comments>
		<pubDate>Mon, 15 Sep 2008 06:19:56 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=642</guid>
		<description><![CDATA[It is amazing how it might come that Microsoft Forums&#8216; RSS feed appears broken on Google Reader with duplicated entries for each of the items.

Regardless of whose the bug is, it seems to me that it is the Microsoft&#8217;s one, both are sophisticated applications of a large scale while RSS thing is just nothing in [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>It is amazing how it might come that <a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=129&amp;SiteID=1">Microsoft Forums</a>&#8216; RSS feed appears broken on Google Reader with duplicated entries for each of the items.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2008/09/15-image001.png"><img class="alignnone size-medium wp-image-641" title="Microsoft Forums, RSS" src="http://alax.info/blog/wp-content/uploads/2008/09/15-image001-300x241.png" alt="" width="300" height="241" /></a></p>
<p>Regardless of whose the bug is, it seems to me that it is the Microsoft&#8217;s one, both are sophisticated applications of a large scale while RSS thing is just nothing in comparison. Was it really difficult to make the darn thing work?</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/642/feed</wfw:commentRss>
		</item>
		<item>
		<title>Buggy Microsoft Forums</title>
		<link>http://alax.info/blog/638</link>
		<comments>http://alax.info/blog/638#comments</comments>
		<pubDate>Tue, 09 Sep 2008 11:08:37 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[forum]]></category>

		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=638</guid>
		<description><![CDATA[It seems that everything is buggy nowadays. Some things - more buggy, some are less. I did not expect Microsoft Forums website to be so&#8230; so&#8230; of so improper quality. Especially compared to variety of popular forum software, free phpbb, google news etc.
MS WYSIWYG post editor can stand no criticism at all, it is one [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>It seems that everything is buggy nowadays. Some things - more buggy, some are less. I did not expect Microsoft Forums website to be so&#8230; so&#8230; of so improper quality. Especially compared to variety of popular forum software, free phpbb, google news etc.</p>
<p>MS WYSIWYG post editor can stand no criticism at all, it is one entire bug under FireFox browser. What I recently start getting is a view of the forum which seems to exclude weeks of recent data:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2008/09/09-image001.png"><img class="alignnone size-medium wp-image-639" title="MS Forums Bug" src="http://alax.info/blog/wp-content/uploads/2008/09/09-image001-300x166.png" alt="" width="300" height="166" /></a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/638/feed</wfw:commentRss>
		</item>
		<item>
		<title>New Visual Studio .NET 2008 annoyances</title>
		<link>http://alax.info/blog/635</link>
		<comments>http://alax.info/blog/635#comments</comments>
		<pubDate>Sun, 07 Sep 2008 21:14:38 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Seriously]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=635</guid>
		<description><![CDATA[Version 2008 (9.0) of Microsoft Visual Studio .NET 2008 Service Pack 1 development environment brings new annoyances in. It seems to be still freezing and crashing on certain source code files, just as previous versions did and additionally there is a new trick in:

A termination of debugged application quite often ends up with a crash. [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>Version 2008 (9.0) of <a href="msdn.microsoft.com/en-us/vstudio/products/default.aspx">Microsoft Visual Studio .NET 2008 Service Pack 1</a> development environment brings new annoyances in. It seems to be still freezing and crashing on certain source code files, just as previous versions did and additionally there is a new trick in:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2008/09/07-image001.png"><img class="alignnone size-medium wp-image-634" title="MS Visual Studio .NET 2008 SP1 Crash" src="http://alax.info/blog/wp-content/uploads/2008/09/07-image001-300x154.png" alt="" width="300" height="154" /></a></p>
<p>A termination of debugged application quite often ends up with a crash. Once crashed, IDE is still alive (thanks, really) but no debugging session will ever start again. A restart of IDE is required. Posted a crash report once again, hopefully someone is receiving them on MS side and takes to consideration.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/635/feed</wfw:commentRss>
		</item>
		<item>
		<title>ATL Registration Script</title>
		<link>http://alax.info/blog/630</link>
		<comments>http://alax.info/blog/630#comments</comments>
		<pubDate>Sat, 06 Sep 2008 16:05:27 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[ATL]]></category>

		<category><![CDATA[com]]></category>

		<category><![CDATA[registry]]></category>

		<category><![CDATA[rgs]]></category>

		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=630</guid>
		<description><![CDATA[Since ATL version 3, and actually it probably existed even since even earlier time, I have seen Microsoft Visual Studio (and its predecessor Visual C++) generating .RGS registration script with hardcoded CLSID value, ProgID values and other strings entered through IDE wizard. While it seems to work nice at the moment of generation, it still [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>Since ATL version 3, and actually it probably existed even since even earlier time, I have seen Microsoft Visual Studio (and its predecessor Visual C++) generating .RGS registration script with hardcoded CLSID value, ProgID values and other strings entered through IDE wizard. While it seems to work nice at the moment of generation, it still gives the problem to lose sync between identifiers if code is copied between projects or a different way. It might be an oversight originally, but was not it the obvious thing to do later to avoid possible typos of inaccurate user? Microsoft Visua Studio 2008 still generates the same code.</p>
<p>Previous versions of development environment offered attributed code option which in fact took care of this problem very well. Although there has been a lot of negative feedback written about C++ attributes, this was a kind of problem attributes left no chances to break: CLSID was specified once only in C++ COM class attribute and the rest of the deal was generated automatically, including IDL and registration sequence.</p>
<p>It is especially unclear why it was left this way because internal ATL classes already have all necessary capabilities to process wildcards. For example, default .RGS script contains an entry for COM class type library, HKCR\CLSID\{&#8230;} key, &#8220;TypeLib&#8221; value. Why would hardcode it if it can be specified through a replacement:</p>
<pre>HKCR
{
	NoRemove CLSID
	{
		ForceRemove %CLSID% = s '...'
		{
<strong><span style="color: #3366ff;">			'TypeLib' = s '%LIBID%'
</span></strong></pre>
<p>And the replacement is so easily added overriding CAtlModule&#8217;s virtual AddCommonRGSReplacements:</p>
<pre>class CFooModule :
	public CAtlDllModuleT&lt;CFooModule&gt;
{
...
// CAtlModule
	HRESULT AddCommonRGSReplacements(IRegistrarBase* pRegistrar) throw()
	{
		_ATLTRY
		{
			ATLENSURE_SUCCEEDED(__super::AddCommonRGSReplacements(pRegistrar));
			ATLASSERT(!IsEqualGUID(m_libid, GUID_NULL));
			ATLENSURE_SUCCEEDED(pRegistrar-&gt;AddReplacement(L"LIBID", StringFromIdentifier(m_libid)));
		}
		_ATLCATCH(Exception)
		{
			return Exception;
		}
		return S_OK;
	}</pre>
<p>I thought it would be implemented natively in ATL long ago, along with per-coclass replacements like %CLSID%.</p>
<p>This is how I like my registration script:</p>
<pre>HKCR
{
	%PROGID% = s '%DESCRIPTION%'
	{
		CLSID = s '%CLSID%'
	}
	%VIPROGID% = s '%DESCRIPTION%'
	{
		CLSID = s '%CLSID%'
		CurVer = s '%PROGID%'
	}
	NoRemove CLSID
	{
		ForceRemove %CLSID% = s '%DESCRIPTION%'
		{
			ProgID = s '%PROGID%'
			VersionIndependentProgID = s '%VIPROGID%'
			ForceRemove 'Programmable'
			InprocServer32 = s '%MODULE%'
			{
				val ThreadingModel = s 'Both'
			}
			TypeLib = s '%LIBID%'
		}
	}
}</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/630/feed</wfw:commentRss>
		</item>
		<item>
		<title>Customer Quotes</title>
		<link>http://alax.info/blog/628</link>
		<comments>http://alax.info/blog/628#comments</comments>
		<pubDate>Wed, 03 Sep 2008 05:58:02 +0000</pubDate>
		<dc:creator>alax</dc:creator>
		
		<category><![CDATA[Seriously]]></category>

		<category><![CDATA[quote]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=628</guid>
		<description><![CDATA[Customer quotes about our product:
By the way, wanted to tell you.  I work in the NVR industry, I&#8217;m a sales engineer for S* http://www.s*.com.  I use your DVR for my 3 home cameras that I&#8217;ve recently put up due to some break ins lately in my community.   I&#8217;ve worked with many commercial DVR/NVR systems in my years [...]]]></description>
			<content:encoded><![CDATA[<div class=""><p>Customer quotes about our product:</p>
<blockquote><p>By the way, wanted to tell you.  I work in the NVR industry, I&#8217;m a sales engineer for S* http://www.s*.com.  I use your DVR for my 3 home cameras that I&#8217;ve recently put up due to some break ins lately in my community.   I&#8217;ve worked with many commercial DVR/NVR systems in my years working in the surveillance industry, you product is awesome.  Now that I have remote monitoring and sequencing configured it&#8217;s working great.  Your support has been rock solid and quick to respond and your server/DVR software is rock solid, it runs 100% of the time.  I&#8217;m a fan! Just wanted to say Thanks!<br />
R*</p></blockquote>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/628/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
