<?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: PInvoke ObjectARX from .NET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/pinvoke-objectarx-from-net/m-p/2295981#M74167</link>
    <description>&amp;gt;&amp;gt; Now this article explains how to do it, so you can do it yourself.&lt;BR /&gt;
&lt;BR /&gt;
Nice article, but some key things one needs to know in order to DIY, were overlooked.&lt;BR /&gt;
&lt;BR /&gt;
Getting the mangled signature is only one part of the puzzle (Depends.exe from www.dependencywalker.com is much better for that than dumpbin.exe, BTW).&lt;BR /&gt;
&lt;BR /&gt;
The more complicated part of the puzzle is understanding how types are marshalled between native and managed code, e.g., knowing what managed type should be used for a given native type. That generally requires a basic understanding of C++ and C++ data types, pointers, and references. It also requires an understanding of the basic differences between how value types and reference types are handled (e..g, when a parameter in a P/Invoke declaration requires 'out' or 'ref').&lt;BR /&gt;
&lt;BR /&gt;
Depends.exe can also halp with that, because it can display the undecorated C++ signature of a function which shows you the C++ types it takes and returns, and that's the key to figuring out the correct P/Invoke declaration.&lt;BR /&gt;
&lt;BR /&gt;
So, while your artcle walks through one specific case, it really doesn't show one how they can do it themself, for any function.&lt;BR /&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 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;SINC&gt; wrote in message news:5977168@discussion.autodesk.com...&lt;BR /&gt;
Here's a little guide to a procedure that can help a lot for people trying to customize Autocad using .NET:&lt;BR /&gt;
&lt;BR /&gt;
http://www.quux.biz/Programming/PInvoke.aspx&lt;BR /&gt;
&lt;BR /&gt;
This explains how to go about using that ObjectARX method that isn't exposed in the managed API.  If you've been hanging out in this group for long, you've probably seen Tony Tanzillo solve problems using this trick.  Now this article explains how to do it, so you can do it yourself.&lt;BR /&gt;
&lt;BR /&gt;
And this brings up another useful tip for .NET programmers:  remember to look at the ObjectARX documentation.  Don't rely on intellisense or the docs for the managed API.  There are a lot of things in ObjectARX that are not in the managed API, so if you aren't reading the ObjectARX documentation, you won't know certain access points even exist.  The managed API documentation is still easier to use for many things, but when you are trying to find a way to accomplish a new task with the API, remember to look in the ObjectARX documentation for methods that are missing from the managed API.&lt;BR /&gt;
&lt;BR /&gt;
-- Sinc&lt;BR /&gt;
http://www.ejsurveying.com&lt;BR /&gt;
http://www.quux.biz&lt;BR /&gt;
http://www.sincpac3d.com&lt;/SINC&gt;</description>
    <pubDate>Wed, 09 Jul 2008 21:18:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-07-09T21:18:38Z</dc:date>
    <item>
      <title>PInvoke ObjectARX from .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/pinvoke-objectarx-from-net/m-p/2295980#M74166</link>
      <description>Here's a little guide to a procedure that can help a lot for people trying to customize Autocad using .NET:&lt;BR /&gt;
&lt;BR /&gt;
http://www.quux.biz/Programming/PInvoke.aspx&lt;BR /&gt;
&lt;BR /&gt;
This explains how to go about using that ObjectARX method that isn't exposed in the managed API.  If you've been hanging out in this group for long, you've probably seen Tony Tanzillo solve problems using this trick.  Now this article explains how to do it, so you can do it yourself.&lt;BR /&gt;
&lt;BR /&gt;
And this brings up another useful tip for .NET programmers:  remember to look at the ObjectARX documentation.  Don't rely on intellisense or the docs for the managed API.  There are a lot of things in ObjectARX that are not in the managed API, so if you aren't reading the ObjectARX documentation, you won't know certain access points even exist.  The managed API documentation is still easier to use for many things, but when you are trying to find a way to accomplish a new task with the API, remember to look in the ObjectARX documentation for methods that are missing from the managed API.&lt;BR /&gt;
&lt;BR /&gt;
-- Sinc&lt;BR /&gt;
http://www.ejsurveying.com&lt;BR /&gt;
http://www.quux.biz&lt;BR /&gt;
http://www.sincpac3d.com</description>
      <pubDate>Wed, 09 Jul 2008 15:56:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/pinvoke-objectarx-from-net/m-p/2295980#M74166</guid>
      <dc:creator>Sinc</dc:creator>
      <dc:date>2008-07-09T15:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: PInvoke ObjectARX from .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/pinvoke-objectarx-from-net/m-p/2295981#M74167</link>
      <description>&amp;gt;&amp;gt; Now this article explains how to do it, so you can do it yourself.&lt;BR /&gt;
&lt;BR /&gt;
Nice article, but some key things one needs to know in order to DIY, were overlooked.&lt;BR /&gt;
&lt;BR /&gt;
Getting the mangled signature is only one part of the puzzle (Depends.exe from www.dependencywalker.com is much better for that than dumpbin.exe, BTW).&lt;BR /&gt;
&lt;BR /&gt;
The more complicated part of the puzzle is understanding how types are marshalled between native and managed code, e.g., knowing what managed type should be used for a given native type. That generally requires a basic understanding of C++ and C++ data types, pointers, and references. It also requires an understanding of the basic differences between how value types and reference types are handled (e..g, when a parameter in a P/Invoke declaration requires 'out' or 'ref').&lt;BR /&gt;
&lt;BR /&gt;
Depends.exe can also halp with that, because it can display the undecorated C++ signature of a function which shows you the C++ types it takes and returns, and that's the key to figuring out the correct P/Invoke declaration.&lt;BR /&gt;
&lt;BR /&gt;
So, while your artcle walks through one specific case, it really doesn't show one how they can do it themself, for any function.&lt;BR /&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 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;SINC&gt; wrote in message news:5977168@discussion.autodesk.com...&lt;BR /&gt;
Here's a little guide to a procedure that can help a lot for people trying to customize Autocad using .NET:&lt;BR /&gt;
&lt;BR /&gt;
http://www.quux.biz/Programming/PInvoke.aspx&lt;BR /&gt;
&lt;BR /&gt;
This explains how to go about using that ObjectARX method that isn't exposed in the managed API.  If you've been hanging out in this group for long, you've probably seen Tony Tanzillo solve problems using this trick.  Now this article explains how to do it, so you can do it yourself.&lt;BR /&gt;
&lt;BR /&gt;
And this brings up another useful tip for .NET programmers:  remember to look at the ObjectARX documentation.  Don't rely on intellisense or the docs for the managed API.  There are a lot of things in ObjectARX that are not in the managed API, so if you aren't reading the ObjectARX documentation, you won't know certain access points even exist.  The managed API documentation is still easier to use for many things, but when you are trying to find a way to accomplish a new task with the API, remember to look in the ObjectARX documentation for methods that are missing from the managed API.&lt;BR /&gt;
&lt;BR /&gt;
-- Sinc&lt;BR /&gt;
http://www.ejsurveying.com&lt;BR /&gt;
http://www.quux.biz&lt;BR /&gt;
http://www.sincpac3d.com&lt;/SINC&gt;</description>
      <pubDate>Wed, 09 Jul 2008 21:18:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/pinvoke-objectarx-from-net/m-p/2295981#M74167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-07-09T21:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: PInvoke ObjectARX from .NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/pinvoke-objectarx-from-net/m-p/2295982#M74168</link>
      <description>Yeah, I know.  I wasn't sure how far I wanted to get into that.  As you know, the topic can quickly become a mess...&lt;BR /&gt;
&lt;BR /&gt;
I think the article gives enough info for people to handle simple cases, like the one used as an example.  I should probably also link to the Microsoft article I found that lists the most-important equivalencies between the C++ and C# types, though, for those who want to get into it further.&lt;BR /&gt;
&lt;BR /&gt;
Someone else pointed me toward dependencywalker.  I should probably add a mention of that to the article.&lt;BR /&gt;
&lt;BR /&gt;
And then there's always stuff like this, which attempts to automatically determine the C# signature by parsing the C++ header files:&lt;BR /&gt;
&lt;BR /&gt;
http://msdn.microsoft.com/en-us/magazine/cc164193.aspx</description>
      <pubDate>Thu, 10 Jul 2008 22:26:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/pinvoke-objectarx-from-net/m-p/2295982#M74168</guid>
      <dc:creator>Sinc</dc:creator>
      <dc:date>2008-07-10T22:26:10Z</dc:date>
    </item>
  </channel>
</rss>

