<?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 .Net Wrapper in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959846#M21350</link>
    <description>I want to wrap a custom entity in a .Net wrapper class. I created the entity class with MFC support, but did not create it for .Net managed code support.&lt;BR /&gt;
&lt;BR /&gt;
Can this be done, if so, what is the easiest method of doing so? I looked at the mgPoly class for an example, but I have to tell you, some of these examples confuse me more then anything. I am using VS 2005 with Acad 2007.&lt;BR /&gt;
&lt;BR /&gt;
Any help or suggestions would be appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
    <pubDate>Fri, 04 May 2007 12:39:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-05-04T12:39:05Z</dc:date>
    <item>
      <title>.Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959846#M21350</link>
      <description>I want to wrap a custom entity in a .Net wrapper class. I created the entity class with MFC support, but did not create it for .Net managed code support.&lt;BR /&gt;
&lt;BR /&gt;
Can this be done, if so, what is the easiest method of doing so? I looked at the mgPoly class for an example, but I have to tell you, some of these examples confuse me more then anything. I am using VS 2005 with Acad 2007.&lt;BR /&gt;
&lt;BR /&gt;
Any help or suggestions would be appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Fri, 04 May 2007 12:39:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959846#M21350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-04T12:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959847#M21351</link>
      <description>So, no answers huh?&lt;BR /&gt;
Man, I wish I could become an ADN member. I am really getting tired of trying to figure everything out on my own. I have a really good idea, why doesn't Autodesk compile the ADN information, questions and answers, into a book and sell it for 99$ US. I would buy a copy....... honestly.&lt;BR /&gt;
&lt;BR /&gt;
Come on, please, someone from Autodesk, give a desperate developer a hand. Arrrggghhh.....No chance there is a free membership for the ADN is there......The company I work for wouldn't pay for it because they are software developers, they have spent 80,000 $ this year on Autodesk products thought, that should count for something :)!! ahhh, didn't think so....&lt;BR /&gt;
&lt;BR /&gt;
Alright, well, back to the drawing board, there has to be a way to figure this out....&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Mon, 07 May 2007 23:53:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959847#M21351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-07T23:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959848#M21352</link>
      <description>Correction, "THE COMPANY I WORK FOR IS NOT A SOFTWARE DEVELOPEMENT COMPANY"... that is why they wouldn't pay for ADN......&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Mon, 07 May 2007 23:54:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959848#M21352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-07T23:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959849#M21353</link>
      <description>Really wish I could help here, but I don't do .Net Autocad.  Keep slugging away.  At some point it will click.  When it does you'll be at a new level of programming.  At some point that will also level out and you'll hit a brick wall again, for a while.  Then 'click', and off to a new level.  The cycle will repeat itself over and over.&lt;BR /&gt;
&lt;BR /&gt;
FWIW...I find ADN useful only for the applications you'll be developing for.  The web interface to the ADN discussion groups is poorly implemented, and finding information is often diffecult.  This group is your best source.&lt;BR /&gt;
&lt;BR /&gt;
Check out http://through-the-interface.typepad.com/ for some really good info .Net with Autocad.&lt;BR /&gt;
&lt;BR /&gt;
Later,&lt;BR /&gt;
Paul Kohut</description>
      <pubDate>Tue, 08 May 2007 07:10:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959849#M21353</guid>
      <dc:creator>pkohut-og</dc:creator>
      <dc:date>2007-05-08T07:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959850#M21354</link>
      <description>The thing about the ADN that makes it useful is the Dev Help Online - rather &lt;BR /&gt;
than asking questions here, where people are helping you out of the goodness &lt;BR /&gt;
of their hearts, you can ask AutoDesk themselves.  If you have difficult &lt;BR /&gt;
questions, they'll get elevated until you're talking to one of the head &lt;BR /&gt;
technical guys.  You're at least assured of a response.  When they can't &lt;BR /&gt;
answer your questions, you know that whatever workaround you've been &lt;BR /&gt;
thinking about is going to be the best course of action.&lt;BR /&gt;
&lt;BR /&gt;
Now, whether that makes it worth the price - maybe not.  But if you're a &lt;BR /&gt;
development company, or if you have to do a lot of internal development &lt;BR /&gt;
(especially if it's on the bleeding edge), it should certainly be a &lt;BR /&gt;
consideration.&lt;BR /&gt;
&lt;BR /&gt;
-Rich&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PKOHUT&gt; wrote in message news:5578145@discussion.autodesk.com...&lt;BR /&gt;
Really wish I could help here, but I don't do .Net Autocad.  Keep slugging &lt;BR /&gt;
away.  At some point it will click.  When it does you'll be at a new level &lt;BR /&gt;
of programming.  At some point that will also level out and you'll hit a &lt;BR /&gt;
brick wall again, for a while.  Then 'click', and off to a new level.  The &lt;BR /&gt;
cycle will repeat itself over and over.&lt;BR /&gt;
&lt;BR /&gt;
FWIW...I find ADN useful only for the applications you'll be developing for. &lt;BR /&gt;
The web interface to the ADN discussion groups is poorly implemented, and &lt;BR /&gt;
finding information is often diffecult.  This group is your best source.&lt;BR /&gt;
&lt;BR /&gt;
Check out http://through-the-interface.typepad.com/ for some really good &lt;BR /&gt;
info .Net with Autocad.&lt;BR /&gt;
&lt;BR /&gt;
Later,&lt;BR /&gt;
Paul Kohut&lt;/PKOHUT&gt;</description>
      <pubDate>Tue, 08 May 2007 18:04:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959850#M21354</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-08T18:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959851#M21355</link>
      <description>Paul Kohut wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&amp;gt; FWIW...I find ADN useful only for the applications you'll &lt;BR /&gt;
&amp;gt;&amp;gt; be developing for.  The web interface to the ADN discussion &lt;BR /&gt;
&amp;gt;&amp;gt; groups is poorly implemented, and finding information is &lt;BR /&gt;
&amp;gt;&amp;gt; often diffecult. &lt;BR /&gt;
&lt;BR /&gt;
So, you know a Kabuki Dance when you see one, eh ? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2008&lt;BR /&gt;
Supporting AutoCAD 2000 through 2008&lt;BR /&gt;
http://www.acadxtabs.com</description>
      <pubDate>Wed, 09 May 2007 02:01:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959851#M21355</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T02:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959852#M21356</link>
      <description>A managed wrapper for a custom object is little more &lt;BR /&gt;
than managed class that derives from one of the &lt;BR /&gt;
managed wrapper classes exposed by AutoCAD, and &lt;BR /&gt;
is housed in a mixed-mode assembly (e.g., /clr ) that &lt;BR /&gt;
contains both managed and unmanaged code, and &lt;BR /&gt;
relies heavily on implicit P/Invoke to call the native &lt;BR /&gt;
custom object code from the managed wrapper code.&lt;BR /&gt;
&lt;BR /&gt;
Your managed wrapper class must derive from the&lt;BR /&gt;
managed wrapper class for the native class that &lt;BR /&gt;
your native custom object derives from. For example,&lt;BR /&gt;
if your custom object derives from AcDbCurve, then&lt;BR /&gt;
your managed wrapper must derive from Autodesk::&lt;BR /&gt;
AutoCAD::DatabaseServices::Curve. If your custom&lt;BR /&gt;
object derives from AcDbEntity, your managed wrapper&lt;BR /&gt;
must derive from ...DatabaseServices::Entity.&lt;BR /&gt;
&lt;BR /&gt;
You must also apply the WrapperAttribute() to your&lt;BR /&gt;
managed wrapper class, and specify the name of the &lt;BR /&gt;
native custom object class that it wraps.&lt;BR /&gt;
&lt;BR /&gt;
The other big piece of the puzzle is implementing&lt;BR /&gt;
a factory (AcMgObjectFactory) which is a protocol&lt;BR /&gt;
extension that you attach to your custom object's &lt;BR /&gt;
AcRxClass.  When the AutoCAD managed runtime &lt;BR /&gt;
needs a wrapper for an instance of your custom &lt;BR /&gt;
object, the factory will be called to create it. &lt;BR /&gt;
&lt;BR /&gt;
However, doing this requires some experience writing &lt;BR /&gt;
managed code; calling unmanaged code from managed &lt;BR /&gt;
code; and doing that in managed C++ or C++/CLI,&lt;BR /&gt;
rather than C# or VB. If you want to expose managed&lt;BR /&gt;
events that get fired by native code, then things get a &lt;BR /&gt;
bit more tricky.&lt;BR /&gt;
&lt;BR /&gt;
So, can we assume that you've have the prerequisites?  &lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2008&lt;BR /&gt;
Supporting AutoCAD 2000 through 2008&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;MIKEB_2K4&gt; wrote in message news:5575077@discussion.autodesk.com...&lt;BR /&gt;
I want to wrap a custom entity in a .Net wrapper class. I created the entity class with MFC support, but did not create it for .Net managed code support.&lt;BR /&gt;
&lt;BR /&gt;
Can this be done, if so, what is the easiest method of doing so? I looked at the mgPoly class for an example, but I have to tell you, some of these examples confuse me more then anything. I am using VS 2005 with Acad 2007.&lt;BR /&gt;
&lt;BR /&gt;
Any help or suggestions would be appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Mike B&lt;/MIKEB_2K4&gt;</description>
      <pubDate>Wed, 09 May 2007 03:00:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959852#M21356</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T03:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959853#M21357</link>
      <description>Well, I have not written any managed c++ or c++/CLI but I have written applications in c#. I cannot fathom why I could handle managed c++ or c++/CLI but you never know I guess until I try.&lt;BR /&gt;
&lt;BR /&gt;
I tried creating a basic managed class to wrap the custom object, but I had alot of build errors. Don't remember what they were because I have deleted that project out of frusteration. I basically followed the mgPoly class.&lt;BR /&gt;
&lt;BR /&gt;
Maybe I will try again with a basic custom entity derived from AcDbEntity that simply draws a line from start -&amp;gt; end point and try again.&lt;BR /&gt;
&lt;BR /&gt;
Now when I create my custom entity, I shouldn't have to have the /clr option is that correct?&lt;BR /&gt;
&lt;BR /&gt;
Ok, well, here I go, traversing up along the learning curve &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Wed, 09 May 2007 12:05:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959853#M21357</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T12:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959854#M21358</link>
      <description>Ok, well, I made yet a second attempt. I created the DBX and the managed wrapper class. I get several linker errors however, so I must be missing something.&lt;BR /&gt;
&lt;BR /&gt;
The build log is attached as an HTML file. Can someone (Tony? maybe) look at it and possibly provide a hint?&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Wed, 09 May 2007 13:13:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959854#M21358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T13:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959855#M21359</link>
      <description>Ok, Linker settings, all set, all compiled. WOW, getting somewhere. &lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Wed, 09 May 2007 13:26:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959855#M21359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T13:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959856#M21360</link>
      <description>Ok, so everything compiled fine. I also created a c# UI application with one command. I was successful at adding my custom object namespace etc.... but when I ran the application, it crashes. One thing it tells me is: &lt;BR /&gt;
Application does not support just-in-time (JIT)&lt;BR /&gt;
debugging.&lt;BR /&gt;
&lt;BR /&gt;
Here was the "Exception Text"&lt;BR /&gt;
[code]&lt;BR /&gt;
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)&lt;BR /&gt;
   at ClassLibrary.Class.test()&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Now I am pretty sure this is a problem with the custom object, but have no idea what the problem would be. In my command I commented out the object creation and just sent a message to the editor and that worked fine.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions on this?&lt;BR /&gt;
&lt;BR /&gt;
Mike Bujak</description>
      <pubDate>Wed, 09 May 2007 15:06:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959856#M21360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T15:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959857#M21361</link>
      <description>I believe the file not found means it wasn't able to find the module &lt;BR /&gt;
containing the object you're trying to create.  You may want to GAC your &lt;BR /&gt;
managed wrapper so it knows where to find it.&lt;BR /&gt;
&lt;BR /&gt;
gacutil.exe /i YourManagedWrapper.dll&lt;BR /&gt;
&lt;BR /&gt;
Although i've written managed C++ and C#, i've not done much of that with &lt;BR /&gt;
AutoCAD - it might not be necessary to GAC.  Maybe your search paths aren't &lt;BR /&gt;
all set correctly?&lt;BR /&gt;
&lt;BR /&gt;
Also, i suggest you put in try catch blocks and catch those types of &lt;BR /&gt;
errors - you will probably get more information than what is displayed in &lt;BR /&gt;
the JIT error box.&lt;BR /&gt;
&lt;BR /&gt;
-Rich&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;MIKEB_2K4&gt; wrote in message news:5580043@discussion.autodesk.com...&lt;BR /&gt;
Ok, so everything compiled fine. I also created a c# UI application with one &lt;BR /&gt;
command. I was successful at adding my custom object namespace etc.... but &lt;BR /&gt;
when I ran the application, it crashes. One thing it tells me is:&lt;BR /&gt;
Application does not support just-in-time (JIT)&lt;BR /&gt;
debugging.&lt;BR /&gt;
&lt;BR /&gt;
Here was the "Exception Text"&lt;BR /&gt;
[code]&lt;BR /&gt;
System.Reflection.TargetInvocationException: Exception has been thrown by &lt;BR /&gt;
the target of an invocation. ---&amp;gt; System.IO.FileNotFoundException: The &lt;BR /&gt;
specified module could not be found. (Exception from HRESULT: 0x8007007E)&lt;BR /&gt;
   at ClassLibrary.Class.test()&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Now I am pretty sure this is a problem with the custom object, but have no &lt;BR /&gt;
idea what the problem would be. In my command I commented out the object &lt;BR /&gt;
creation and just sent a message to the editor and that worked fine.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions on this?&lt;BR /&gt;
&lt;BR /&gt;
Mike Bujak&lt;/MIKEB_2K4&gt;</description>
      <pubDate>Wed, 09 May 2007 16:15:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959857#M21361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T16:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959858#M21362</link>
      <description>Thanks for the reply. I do have another question. I used NETLOAD to load the UI. Am I supposed to do this with my object wrapper dll as well? I ran NETLOAD on the wrapper dll and I get the same errors, but display in the autocad editor, so it probably isn't a case of not finding the wrapper object dll but a dll the wrapper class uses?&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Wed, 09 May 2007 17:42:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959858#M21362</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-09T17:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: .Net Wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959859#M21363</link>
      <description>You don't need to NETLOAD if your managed wrapper is in a mixed mode DLL. &lt;BR /&gt;
Don't forget to register the wrapper's class factory via AcMgObjectFactory. &lt;BR /&gt;
This is how AutoCAD knows to instantiate your managed wrapper when it needs &lt;BR /&gt;
to.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"MikeB_2K4" wrote in message news:5580423@discussion.autodesk.com...&lt;BR /&gt;
Thanks for the reply. I do have another question. I used NETLOAD to load the &lt;BR /&gt;
UI. Am I supposed to do this with my object wrapper dll as well? I ran &lt;BR /&gt;
NETLOAD on the wrapper dll and I get the same errors, but display in the &lt;BR /&gt;
autocad editor, so it probably isn't a case of not finding the wrapper &lt;BR /&gt;
object dll but a dll the wrapper class uses?&lt;BR /&gt;
&lt;BR /&gt;
Mike B</description>
      <pubDate>Fri, 11 May 2007 17:18:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/net-wrapper/m-p/1959859#M21363</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-11T17:18:13Z</dc:date>
    </item>
  </channel>
</rss>

