<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: QueryInterface() problem in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965089#M21296</link>
    <description>Yes, that is exactly what you have to do.  I recommend to use the &lt;BR /&gt;
preprocessor symbol _ACADTARGET set to 15/16/17 for the different versions &lt;BR /&gt;
of the ObjectARX SDK. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft ==&amp;gt; http://www.manusoft.com&lt;BR /&gt;
VP Americas, CADLock, Inc. ==&amp;gt; http://www.cadlock.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;SIMAS_LUK&gt; wrote in message news:5582729@discussion.autodesk.com...&lt;BR /&gt;
The only thing is ObjectARX doesn't provide version define (ACAD_VERSION). &lt;BR /&gt;
As I understand I have to define it somewhere else myself? As I am using &lt;BR /&gt;
different visual c++ project configurations for 2004 and 2007 ObjectARX &lt;BR /&gt;
builds, the only solution I see is preprocessor definitions for different &lt;BR /&gt;
versions. Am I right?&lt;/SIMAS_LUK&gt;</description>
    <pubDate>Fri, 11 May 2007 12:39:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-05-11T12:39:47Z</dc:date>
    <item>
      <title>QueryInterface() problem</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965084#M21291</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
After migration to ObjectARX 2007 I have troubles retrieving IAcadApplication interface to add menu items. The code looks something like this:&lt;BR /&gt;
&lt;BR /&gt;
      CComPtr&amp;lt; IDispatch &amp;gt; pAcadDisp = NULL;&lt;BR /&gt;
      pAcadDisp = acedGetAcadWinApp()-&amp;gt;GetIDispatch(TRUE); &lt;BR /&gt;
&lt;BR /&gt;
      CComPtr&amp;lt; IAcadApplication &amp;gt; pAcad;&lt;BR /&gt;
      hr = pAcadDisp-&amp;gt;QueryInterface(IID_IAcadApplication, (void**)&amp;amp;pAcad); // fails here with HRESULT of E_NOINTERFACE&lt;BR /&gt;
&lt;BR /&gt;
I have checked IID_IAcadApplicatio identifier and it seems that I get one that is specified in ObjectARX 2004.&lt;BR /&gt;
2007 version:&lt;BR /&gt;
MIDL_DEFINE_GUID(IID, IID_IAcadApplication,0x8F17437C,0x2EFB,0x4FC4,0x81,0x88,0xEE,0xFA,0x50,0xFE,0x71,0x47);&lt;BR /&gt;
&lt;BR /&gt;
2004 version:&lt;BR /&gt;
MIDL_DEFINE_GUID(IID, IID_IAcadApplication,0x93bc4e71,0xafe7,0x4aa7,0xbc,0x07,0xf8,0x0a,0xcd,0xb6,0x72,0xd5);&lt;BR /&gt;
&lt;BR /&gt;
I'm not a COM expert and I can't figure out how is it possible that IID_IAcadApplication is from 2004 OARX version. All paths are set to 2007 OARX.&lt;BR /&gt;
I have tryed manually change this identifier through the VS IDE and everything worked fine.&lt;BR /&gt;
I have 2005, 2007, 2008 AutoCAD installed on my computer.&lt;BR /&gt;
Any ideas?</description>
      <pubDate>Thu, 10 May 2007 08:33:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965084#M21291</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-10T08:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: QueryInterface() problem</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965085#M21292</link>
      <description>My mistake.. forgot to increment type library index from 16 to 17:&lt;BR /&gt;
&lt;BR /&gt;
// Import AutoCAD COM interfaces&lt;BR /&gt;
#import "acax17enu.tlb" raw_interfaces_only no_namespace</description>
      <pubDate>Thu, 10 May 2007 09:19:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965085#M21292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-10T09:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: QueryInterface() problem</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965086#M21293</link>
      <description>We're currently using same source code to build ARX app with ARX2004 and ARX2007. How would you suggest to manage version indices in this situation? Maybe there is a ObjectARX define for the version? Something like this:&lt;BR /&gt;
&lt;BR /&gt;
#if ACAD_VERSION = 16&lt;BR /&gt;
#import "acax16enu.tlb" raw_interfaces_only no_namespace&lt;BR /&gt;
#elseif ACAD_VERSION = 17&lt;BR /&gt;
#import "acax17enu.tlb" raw_interfaces_only no_namespace&lt;BR /&gt;
#endif</description>
      <pubDate>Thu, 10 May 2007 14:06:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965086#M21293</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-10T14:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: QueryInterface() problem</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965087#M21294</link>
      <description>You have to do exactly as you suggest. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft ==&amp;gt; http://www.manusoft.com&lt;BR /&gt;
VP Americas, CADLock, Inc. ==&amp;gt; http://www.cadlock.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;SIMAS_LUK&gt; wrote in message news:5581522@discussion.autodesk.com...&lt;BR /&gt;
We're currently using same source code to build ARX app with ARX2004 and &lt;BR /&gt;
ARX2007. How would you suggest to manage version indices in this situation? &lt;BR /&gt;
Maybe there is a ObjectARX define for the version? Something like this:&lt;BR /&gt;
&lt;BR /&gt;
#if ACAD_VERSION = 16&lt;BR /&gt;
#import "acax16enu.tlb" raw_interfaces_only no_namespace&lt;BR /&gt;
#elseif ACAD_VERSION = 17&lt;BR /&gt;
#import "acax17enu.tlb" raw_interfaces_only no_namespace&lt;BR /&gt;
#endif&lt;/SIMAS_LUK&gt;</description>
      <pubDate>Thu, 10 May 2007 16:34:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965087#M21294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-10T16:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: QueryInterface() problem</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965088#M21295</link>
      <description>The only thing is ObjectARX doesn't provide version define (ACAD_VERSION). As I understand I have to define it somewhere else myself? As I am using different visual c++ project configurations for 2004 and 2007 ObjectARX builds, the only solution I see is preprocessor definitions for different versions. Am I right?</description>
      <pubDate>Fri, 11 May 2007 06:22:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965088#M21295</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-11T06:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: QueryInterface() problem</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965089#M21296</link>
      <description>Yes, that is exactly what you have to do.  I recommend to use the &lt;BR /&gt;
preprocessor symbol _ACADTARGET set to 15/16/17 for the different versions &lt;BR /&gt;
of the ObjectARX SDK. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
-- &lt;BR /&gt;
Owen Wengerd&lt;BR /&gt;
President, ManuSoft ==&amp;gt; http://www.manusoft.com&lt;BR /&gt;
VP Americas, CADLock, Inc. ==&amp;gt; http://www.cadlock.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;SIMAS_LUK&gt; wrote in message news:5582729@discussion.autodesk.com...&lt;BR /&gt;
The only thing is ObjectARX doesn't provide version define (ACAD_VERSION). &lt;BR /&gt;
As I understand I have to define it somewhere else myself? As I am using &lt;BR /&gt;
different visual c++ project configurations for 2004 and 2007 ObjectARX &lt;BR /&gt;
builds, the only solution I see is preprocessor definitions for different &lt;BR /&gt;
versions. Am I right?&lt;/SIMAS_LUK&gt;</description>
      <pubDate>Fri, 11 May 2007 12:39:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/queryinterface-problem/m-p/1965089#M21296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-11T12:39:47Z</dc:date>
    </item>
  </channel>
</rss>

