<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Not able to get memory of Hierarchy in QT-COM]]></title><description><![CDATA[<p dir="auto">We have Base and 2 derived class, If we try to get the derived class memory in COM using Queryinterface we face a Error: "E_NOINTERFACE No such interface supported".</p>
<p dir="auto">Code snippet :</p>
<p dir="auto">Main.cpp</p>
<p dir="auto">QAXFACTORY_BEGIN((SWIQAX_FACTORY_BEGIN, SWIQAX_FACTORY_END)<br />
QAXCLASS(Base)<br />
QAXTYPE(D1)<br />
QAXTYPE(D2)<br />
QAXFACTORY_END()</p>
<p dir="auto">Class Base {}</p>
<p dir="auto">Class D1 : Base {}</p>
<p dir="auto">Class D2 : D1 {}</p>
<p dir="auto">In Client :</p>
<p dir="auto">CComPtr&lt;Base&gt; B1;<br />
CComPtr&lt;D2&gt; D1;<br />
CComPtr&lt;D2&gt; D2;<br />
HRESULT hr = B1-&gt;CoCreate(uuid(Base));</p>
<p dir="auto">HRESULT hr1 = B1.QueryInterface(&amp;D2); -&gt; Here We are able to get memory of D2</p>
<p dir="auto">HRESULT hr2 = B1.QueryInterface(&amp;D1); -&gt; Here we are not able to get the memory for D1 (NULL)<br />
HRESULT hr3 = D2.QueryInterface(&amp;D1);  -&gt; Here also we are not able to get the memory for D1 (NULL)</p>
<p dir="auto">Is there any way we can get memory of D1 ? or any macro like QAXFACTORY_BEGIN will help us to get D1 memory</p>
]]></description><link>https://forum.qt.io/topic/145968/not-able-to-get-memory-of-hierarchy-in-qt-com</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 10:20:27 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145968.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Jun 2023 13:01:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Not able to get memory of Hierarchy in QT-COM on Tue, 27 Jun 2023 12:36:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hskoglund">@<bdi>hskoglund</bdi></a></p>
<p dir="auto">Yes we have made syntax  error on code which we have posted as you said we have tried on it but still we are facing same issue not able to get D1.</p>
]]></description><link>https://forum.qt.io/post/762748</link><guid isPermaLink="true">https://forum.qt.io/post/762748</guid><dc:creator><![CDATA[Madhura]]></dc:creator><pubDate>Tue, 27 Jun 2023 12:36:54 GMT</pubDate></item><item><title><![CDATA[Reply to Not able to get memory of Hierarchy in QT-COM on Sat, 24 Jun 2023 00:19:00 GMT]]></title><description><![CDATA[<p dir="auto">In the client's code, try change from:</p>
<pre><code>...
CComPtr&lt;D2&gt; D1;
CComPtr&lt;D2&gt; D2;
...
</code></pre>
<p dir="auto">to</p>
<pre><code>...
CComPtr&lt;D1&gt; D1;
CComPtr&lt;D2&gt; D2;
...
</code></pre>
]]></description><link>https://forum.qt.io/post/762497</link><guid isPermaLink="true">https://forum.qt.io/post/762497</guid><dc:creator><![CDATA[hskoglund]]></dc:creator><pubDate>Sat, 24 Jun 2023 00:19:00 GMT</pubDate></item></channel></rss>