<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Getting an interface back out of a Variant</title>
	<atom:link href="http://blog.excastle.com/2005/07/06/getting-an-interface-back-out-of-a-variant/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.excastle.com/2005/07/06/getting-an-interface-back-out-of-a-variant/</link>
	<description>Life, .NET, and Cats</description>
	<lastBuildDate>Tue, 31 Aug 2010 13:47:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Joe White's Blog</title>
		<link>http://blog.excastle.com/2005/07/06/getting-an-interface-back-out-of-a-variant/comment-page-1/#comment-5391</link>
		<dc:creator>Joe White's Blog</dc:creator>
		<pubDate>Sun, 10 Jul 2005 15:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/07/06/getting-an-interface-back-out-of-a-variant/#comment-5391</guid>
		<description>&lt;strong&gt;Pathological QueryInterfaces&lt;/strong&gt;


</description>
		<content:encoded><![CDATA[<p><strong>Pathological QueryInterfaces</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://blog.excastle.com/2005/07/06/getting-an-interface-back-out-of-a-variant/comment-page-1/#comment-5390</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Sat, 09 Jul 2005 09:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/07/06/getting-an-interface-back-out-of-a-variant/#comment-5390</guid>
		<description>Have you tested that Supports() puts nil to the &quot;out Intf&quot; parameter if the interface is NOT supported? &lt;br&gt;This isn&#039;t really clear from the docs so I would recommend&lt;br&gt;&lt;br&gt;function VariantAsIFoo(V: Variant): IFoo;&lt;br&gt;begin&lt;br&gt;  Result:=nil;&lt;br&gt;  if VarIsType(V, varUnknown) then&lt;br&gt;    Supports(V, IFoo, Result);&lt;br&gt;end;&lt;br&gt;&lt;br&gt;or if you don&#039;t like unnecessary assignments&lt;br&gt;&lt;br&gt;function VariantAsIFoo(V: Variant): IFoo;&lt;br&gt;begin&lt;br&gt;  if VarIsType(V, varUnknown) then&lt;br&gt;  begin&lt;br&gt;    if not Supports(V, IFoo, Result) then&lt;br&gt;      Result:=nil;&lt;br&gt;  end else&lt;br&gt;    Result := nil;&lt;br&gt;end;&lt;br&gt;&lt;br&gt;Anyway thanks for sharing! I really enjoy reading your blog!
</description>
		<content:encoded><![CDATA[<p>Have you tested that Supports() puts nil to the &quot;out Intf&quot; parameter if the interface is NOT supported?<br />
<br />This isn&#8217;t really clear from the docs so I would recommend</p>
<p>function VariantAsIFoo(V: Variant): IFoo;<br />
<br />begin<br />
<br />  Result:=nil;<br />
<br />  if VarIsType(V, varUnknown) then<br />
<br />    Supports(V, IFoo, Result);<br />
<br />end;</p>
<p>or if you don&#8217;t like unnecessary assignments</p>
<p>function VariantAsIFoo(V: Variant): IFoo;<br />
<br />begin<br />
<br />  if VarIsType(V, varUnknown) then<br />
<br />  begin<br />
<br />    if not Supports(V, IFoo, Result) then<br />
<br />      Result:=nil;<br />
<br />  end else<br />
<br />    Result := nil;<br />
<br />end;</p>
<p>Anyway thanks for sharing! I really enjoy reading your blog!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
