<?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 ATL ObjectArx works from Acad VBA but not from VB in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/atl-objectarx-works-from-acad-vba-but-not-from-vb/m-p/311049#M39924</link>
    <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to create a ATL (COM Application) and I'm confused here.&lt;BR /&gt;
&lt;BR /&gt;
First scenario:&lt;BR /&gt;
    I created a ATL project, added an ATL Object &amp;amp; added a method to it,&lt;BR /&gt;
then I added the ObjectArx code and it loaded fine in AutoCAD Map and the&lt;BR /&gt;
AcadTest module run successfully from AutoCAD Map.&lt;BR /&gt;
&lt;BR /&gt;
    I wrote a simple module in AutoCAD Map VBA to communicate with the ATL&lt;BR /&gt;
Object I created and it worked fine.&lt;BR /&gt;
&lt;BR /&gt;
    The problem is when I copied the same code in VBA under Excel, it gave&lt;BR /&gt;
me an error when creating the Object "Set sTest = New MyAtlObject.MyMethod"&lt;BR /&gt;
it gave me the following error: "Automation Error. The specified module&lt;BR /&gt;
could not be found"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The second scenario:&lt;BR /&gt;
    I created an ObjectArx project from VC++ and added an ATL Object from&lt;BR /&gt;
the ObjectArx Toolbar, and created a method.&lt;BR /&gt;
&lt;BR /&gt;
    I end up with the same problem.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I even made a reg file for the application with no luck. Also when I try to&lt;BR /&gt;
run the "Register Control" from the VC++ "Tolls" menu, it gives me the&lt;BR /&gt;
following error: "The specified module could not be found".&lt;BR /&gt;
Can anyone tell me what's wrong here as this is driving me nuts. Your help&lt;BR /&gt;
will be deeply appreciated.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Best regards&lt;BR /&gt;
&lt;BR /&gt;
Wael Bakr</description>
    <pubDate>Wed, 31 Jul 2002 14:10:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-07-31T14:10:50Z</dc:date>
    <item>
      <title>ATL ObjectArx works from Acad VBA but not from VB</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/atl-objectarx-works-from-acad-vba-but-not-from-vb/m-p/311049#M39924</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to create a ATL (COM Application) and I'm confused here.&lt;BR /&gt;
&lt;BR /&gt;
First scenario:&lt;BR /&gt;
    I created a ATL project, added an ATL Object &amp;amp; added a method to it,&lt;BR /&gt;
then I added the ObjectArx code and it loaded fine in AutoCAD Map and the&lt;BR /&gt;
AcadTest module run successfully from AutoCAD Map.&lt;BR /&gt;
&lt;BR /&gt;
    I wrote a simple module in AutoCAD Map VBA to communicate with the ATL&lt;BR /&gt;
Object I created and it worked fine.&lt;BR /&gt;
&lt;BR /&gt;
    The problem is when I copied the same code in VBA under Excel, it gave&lt;BR /&gt;
me an error when creating the Object "Set sTest = New MyAtlObject.MyMethod"&lt;BR /&gt;
it gave me the following error: "Automation Error. The specified module&lt;BR /&gt;
could not be found"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The second scenario:&lt;BR /&gt;
    I created an ObjectArx project from VC++ and added an ATL Object from&lt;BR /&gt;
the ObjectArx Toolbar, and created a method.&lt;BR /&gt;
&lt;BR /&gt;
    I end up with the same problem.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I even made a reg file for the application with no luck. Also when I try to&lt;BR /&gt;
run the "Register Control" from the VC++ "Tolls" menu, it gives me the&lt;BR /&gt;
following error: "The specified module could not be found".&lt;BR /&gt;
Can anyone tell me what's wrong here as this is driving me nuts. Your help&lt;BR /&gt;
will be deeply appreciated.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Best regards&lt;BR /&gt;
&lt;BR /&gt;
Wael Bakr</description>
      <pubDate>Wed, 31 Jul 2002 14:10:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/atl-objectarx-works-from-acad-vba-but-not-from-vb/m-p/311049#M39924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-07-31T14:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: ATL ObjectArx works from Acad VBA but not from VB</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/atl-objectarx-works-from-acad-vba-but-not-from-vb/m-p/311050#M39925</link>
      <description>An ARX COM server must be loaded into AutoCAD's process&lt;BR /&gt;
(either as an ARX module or a standard COM server).&lt;BR /&gt;
&lt;BR /&gt;
To do this from an out-of-process client, you have to&lt;BR /&gt;
use the GetInterfaceObject() method of the AutoCAD&lt;BR /&gt;
Application object.&lt;BR /&gt;
&lt;BR /&gt;
When you create an ActiveX object using the 'New' keyword&lt;BR /&gt;
in VB or VBA, it tries to load the ActiveX object into the&lt;BR /&gt;
host process, which is not Acad.exe.&lt;BR /&gt;
&lt;BR /&gt;
Just load your COM server like this:&lt;BR /&gt;
&lt;BR /&gt;
  Dim Acad As AcadApplication&lt;BR /&gt;
  Dim YourObject As &lt;LIBRARYNAME&gt;.&lt;COCLASSNAME&gt;&lt;BR /&gt;
  Set Acad = GetObject(, "AutoCAD.Application")&lt;BR /&gt;
  Set YourObject = Acad.GetInterfaceObject("&lt;PROGID&gt;")&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Wael Bakr" &lt;BAKR&gt; wrote in message&lt;BR /&gt;
news:B4AD1B42627B39D18822DBDCCBDBB750@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; Hi All,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I'm trying to create a ATL (COM Application) and I'm confused here.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; First scenario:&lt;BR /&gt;
&amp;gt;     I created a ATL project, added an ATL Object &amp;amp; added a method to it,&lt;BR /&gt;
&amp;gt; then I added the ObjectArx code and it loaded fine in AutoCAD Map and the&lt;BR /&gt;
&amp;gt; AcadTest module run successfully from AutoCAD Map.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     I wrote a simple module in AutoCAD Map VBA to communicate with the ATL&lt;BR /&gt;
&amp;gt; Object I created and it worked fine.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     The problem is when I copied the same code in VBA under Excel, it gave&lt;BR /&gt;
&amp;gt; me an error when creating the Object "Set sTest = New&lt;BR /&gt;
MyAtlObject.MyMethod"&lt;BR /&gt;
&amp;gt; it gave me the following error: "Automation Error. The specified module&lt;BR /&gt;
&amp;gt; could not be found"&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; The second scenario:&lt;BR /&gt;
&amp;gt;     I created an ObjectArx project from VC++ and added an ATL Object from&lt;BR /&gt;
&amp;gt; the ObjectArx Toolbar, and created a method.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;     I end up with the same problem.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I even made a reg file for the application with no luck. Also when I try&lt;BR /&gt;
to&lt;BR /&gt;
&amp;gt; run the "Register Control" from the VC++ "Tolls" menu, it gives me the&lt;BR /&gt;
&amp;gt; following error: "The specified module could not be found".&lt;BR /&gt;
&amp;gt; Can anyone tell me what's wrong here as this is driving me nuts. Your help&lt;BR /&gt;
&amp;gt; will be deeply appreciated.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Best regards&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Wael Bakr&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/BAKR&gt;&lt;/PROGID&gt;&lt;/COCLASSNAME&gt;&lt;/LIBRARYNAME&gt;</description>
      <pubDate>Wed, 31 Jul 2002 14:10:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/atl-objectarx-works-from-acad-vba-but-not-from-vb/m-p/311050#M39925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-07-31T14:10:50Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/atl-objectarx-works-from-acad-vba-but-not-from-vb/m-p/311051#M39926</link>
      <description>Tony,&lt;BR /&gt;
Thanks, with your support, I'm going full speed.&lt;BR /&gt;
&lt;BR /&gt;
Best regards&lt;BR /&gt;
&lt;BR /&gt;
wael Bakr&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO at="" caddzone="" dot="" com=""&gt; wrote in message&lt;BR /&gt;
news:765F8E955E782025A9ABF3790413B89E@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; An ARX COM server must be loaded into AutoCAD's process&lt;BR /&gt;
&amp;gt; (either as an ARX module or a standard COM server).&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; To do this from an out-of-process client, you have to&lt;BR /&gt;
&amp;gt; use the GetInterfaceObject() method of the AutoCAD&lt;BR /&gt;
&amp;gt; Application object.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; When you create an ActiveX object using the 'New' keyword&lt;BR /&gt;
&amp;gt; in VB or VBA, it tries to load the ActiveX object into the&lt;BR /&gt;
&amp;gt; host process, which is not Acad.exe.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Just load your COM server like this:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   Dim Acad As AcadApplication&lt;BR /&gt;
&amp;gt;   Dim YourObject As &lt;LIBRARYNAME&gt;.&lt;COCLASSNAME&gt;&lt;BR /&gt;
&amp;gt;   Set Acad = GetObject(, "AutoCAD.Application")&lt;BR /&gt;
&amp;gt;   Set YourObject = Acad.GetInterfaceObject("&lt;PROGID&gt;")&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Wael Bakr" &lt;BAKR&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:B4AD1B42627B39D18822DBDCCBDBB750@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; Hi All,&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; I'm trying to create a ATL (COM Application) and I'm confused here.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; First scenario:&lt;BR /&gt;
&amp;gt; &amp;gt;     I created a ATL project, added an ATL Object &amp;amp; added a method to it,&lt;BR /&gt;
&amp;gt; &amp;gt; then I added the ObjectArx code and it loaded fine in AutoCAD Map and&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; &amp;gt; AcadTest module run successfully from AutoCAD Map.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     I wrote a simple module in AutoCAD Map VBA to communicate with the&lt;BR /&gt;
ATL&lt;BR /&gt;
&amp;gt; &amp;gt; Object I created and it worked fine.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     The problem is when I copied the same code in VBA under Excel, it&lt;BR /&gt;
gave&lt;BR /&gt;
&amp;gt; &amp;gt; me an error when creating the Object "Set sTest = New&lt;BR /&gt;
&amp;gt; MyAtlObject.MyMethod"&lt;BR /&gt;
&amp;gt; &amp;gt; it gave me the following error: "Automation Error. The specified module&lt;BR /&gt;
&amp;gt; &amp;gt; could not be found"&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; The second scenario:&lt;BR /&gt;
&amp;gt; &amp;gt;     I created an ObjectArx project from VC++ and added an ATL Object&lt;BR /&gt;
from&lt;BR /&gt;
&amp;gt; &amp;gt; the ObjectArx Toolbar, and created a method.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;     I end up with the same problem.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; I even made a reg file for the application with no luck. Also when I try&lt;BR /&gt;
&amp;gt; to&lt;BR /&gt;
&amp;gt; &amp;gt; run the "Register Control" from the VC++ "Tolls" menu, it gives me the&lt;BR /&gt;
&amp;gt; &amp;gt; following error: "The specified module could not be found".&lt;BR /&gt;
&amp;gt; &amp;gt; Can anyone tell me what's wrong here as this is driving me nuts. Your&lt;BR /&gt;
help&lt;BR /&gt;
&amp;gt; &amp;gt; will be deeply appreciated.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Best regards&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Wael Bakr&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/BAKR&gt;&lt;/PROGID&gt;&lt;/COCLASSNAME&gt;&lt;/LIBRARYNAME&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 01 Aug 2002 06:40:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/atl-objectarx-works-from-acad-vba-but-not-from-vb/m-p/311051#M39926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-08-01T06:40:38Z</dc:date>
    </item>
  </channel>
</rss>

