<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>ObjectARX on ManuSoft</title><link>http://www.manusoft.com/tags/objectarx/</link><description>Recent content in ObjectARX on ManuSoft</description><generator>Hugo</generator><language>en-us</language><copyright>1991–2026</copyright><lastBuildDate>Tue, 18 Feb 2014 01:36:34 +0000</lastBuildDate><atom:link href="http://www.manusoft.com/tags/objectarx/index.xml" rel="self" type="application/rss+xml"/><item><title>Building a commercial grade lisp plugin installer in 5 easy steps</title><link>http://www.manusoft.com/archive/blog/building-a-commercial-grade-lisp-plugin-installer-in-5-easy-steps/</link><pubDate>Tue, 18 Feb 2014 01:36:34 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/building-a-commercial-grade-lisp-plugin-installer-in-5-easy-steps/</guid><description>&lt;p&gt;Rumors about the death of AutoLISP have been floating around for many years, but fear not, those rumors are greatly exaggerated. Bricscad and ZWCAD both have excellent support for lisp plugins, so well-written lisp code is truly cross-platform and enjoys a large and growing audience. Unlike other languages, the vast majority of lisp code works unmodified on any hardware architecture, in any version of Windows, and inside any host application that supports it, including AutoCAD versions released more than a decade ago. On top of that, &lt;a href="http://www.opendcl.com" target="_blank"&gt;OpenDCL&lt;/a&gt; gives lisp developers the power of a modern event-driven user interface that can put their lisp plugins on the same playing field as plugins written in any other language. This is a powerful combination, and given lisp&amp;rsquo;s low entry cost, it is not surprising to see lisp continuing to enjoy strong support in the developer community.&lt;/p&gt;</description></item><item><title>Don't catch what you can't handle</title><link>http://www.manusoft.com/archive/blog/dont-catch-what-you-cant-handle/</link><pubDate>Fri, 07 Feb 2014 00:10:41 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/dont-catch-what-you-cant-handle/</guid><description>&lt;p&gt;One of the cardinal rules of C++ exception handling is &lt;em&gt;&amp;ldquo;don&amp;rsquo;t catch what you can&amp;rsquo;t handle&amp;rdquo;&lt;/em&gt;. Of course there are always, er, exceptions to the rule, but the basic principle always holds. The consequences of violating the rule are less severe in the .NET world, but even there it&amp;rsquo;s a good rule of thumb.&lt;/p&gt;</description></item><item><title>LspLoad Updated for AutoCAD 2014 and Bricscad 13 64-bit</title><link>http://www.manusoft.com/archive/blog/lspload-updated-for-autocad-2014-and-bricscad-13-64-bit/</link><pubDate>Sat, 13 Apr 2013 20:58:40 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/lspload-updated-for-autocad-2014-and-bricscad-13-64-bit/</guid><description>&lt;p&gt;The &lt;a href="http://otb.manusoft.com/2009/12/automatic-lisp-loading.htm"&gt;automatic lisp loader modules&lt;/a&gt; (LspLoad.zip on my &lt;a href="http://www.manusoft.com/software/freebies/arx.html"&gt;freebies page&lt;/a&gt;) have been updated to add support for AutoCAD 2014 and Bricscad 13 64-bit. The modules are now digitally signed so that AutoCAD 2014 loads them quietly.&lt;/p&gt;</description></item><item><title>Using /delayload to specify dependent DLL path</title><link>http://www.manusoft.com/archive/blog/using-delayload-to-specify-dependent-dll-path/</link><pubDate>Sat, 26 Jan 2013 01:03:48 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/using-delayload-to-specify-dependent-dll-path/</guid><description>&lt;p&gt;Let&amp;rsquo;s say you have an ObjectARX module with an implicit dependency on another DLL. Your installer puts both your ARX module and the dependent DLL into a private application folder. Windows must be able to resolve the implicit DLL dependency at load time, otherwise it will fail to load your ARX module. Alas, Windows will not automatically search for the dependent DLL in your application folder, even though your ARX module is located there. Therefore your ARX module won&amp;rsquo;t load because the dependent DLL cannot be resolved.&lt;/p&gt;</description></item><item><title>QuirkyPolyline: exposing foolish programmers</title><link>http://www.manusoft.com/archive/blog/quirkypolyline-exposing-foolish-programmers/</link><pubDate>Wed, 09 Jan 2013 02:38:45 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/quirkypolyline-exposing-foolish-programmers/</guid><description>&lt;p&gt;In AutoCAD, the &lt;a href="http://docs.autodesk.com/ACDMAC/2012/ENU/ObjectARX%20Reference/AcDbCurve.html" target="_blank"&gt;AcDbCurve class&lt;/a&gt; defines a general parametrized curve. On a parametrized curve, points in space are mapped to real numbers (parameters) by an arbitrary function &lt;em&gt;F(p)&lt;/em&gt; for values of &lt;em&gt;p&lt;/em&gt; from the curve start parameter to the curve end parameter. Defining a curve this way simplifies working with complex 3D curves because one can work in the curve&amp;rsquo;s one dimensional &amp;ldquo;parameter space&amp;rdquo; instead of the more complex three dimensional cartesian space.&lt;/p&gt;</description></item><item><title>Polymorphic bit flags in C++</title><link>http://www.manusoft.com/archive/blog/polymorphic-bit-flags-in-c/</link><pubDate>Wed, 19 Dec 2012 11:55:45 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/polymorphic-bit-flags-in-c/</guid><description>&lt;p&gt;I often encounter cases in ObjectARX programming where numerous boolean flags need to be persisted as part of an AutoCAD database object. For filing and for passing around to other functions, it&amp;rsquo;s most efficient to package those bit flags into a single unsigned integer. Below is an example that demonstrates how to use a union inside a containing class that can be simultaneously used as either a single unsigned integer or as individual booleans.&lt;/p&gt;</description></item><item><title>Checking function return values</title><link>http://www.manusoft.com/archive/blog/checking-function-return-values/</link><pubDate>Thu, 30 Aug 2012 15:48:36 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/checking-function-return-values/</guid><description>&lt;p&gt;A lot of you are guilty of not checking return values from API function calls. I&amp;rsquo;ll bet you have a good excuse, like &lt;em&gt;&amp;ldquo;it&amp;rsquo;s a lot of extra typing for no reason&amp;rdquo;&lt;/em&gt;, or &lt;em&gt;&amp;ldquo;that function should never return an error code&amp;rdquo;&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Registering an ARX/BRX module as a COM server</title><link>http://www.manusoft.com/archive/blog/registering-an-arxbrx-module-as-a-com-server/</link><pubDate>Tue, 11 Oct 2011 00:18:41 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/registering-an-arxbrx-module-as-a-com-server/</guid><description>&lt;p&gt;If you&amp;rsquo;re developing ARX modules that need to be registered as a COM server, you&amp;rsquo;re faced with some decisions about how to register them. In the old days before anyone cared about user permissions, registration could be safely accomplished at runtime, even via AutoLISP. Unfortunately runtime COM server registration just doesn&amp;rsquo;t work reliably any more under limited user accounts, not to mention registry redirection on 64-bit platforms. There is only one reliable way to register COM servers, and that&amp;rsquo;s doing it at install time under elevated privileges.&lt;/p&gt;</description></item><item><title>ObjectARX Wizard for Visual Studio 2010</title><link>http://www.manusoft.com/archive/blog/objectarx-wizard-for-visual-studio-2010/</link><pubDate>Fri, 01 Apr 2011 20:04:33 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/objectarx-wizard-for-visual-studio-2010/</guid><description>&lt;p&gt;If you&amp;rsquo;re an ObjectARX programmer, you may still be using Visual Studio 2008 because you&amp;rsquo;ve been told that you must. It&amp;rsquo;s true that you need Visual Studio 2008 installed to compile native ObjectARX code, but with &lt;a href="http://daffodil.codeplex.com"&gt;Daffodil&lt;/a&gt; you can &lt;a href="http://otb.manusoft.com/2010/10/visual-studio-2010-native-multi-targeting.htm"&gt;do all your work in the Visual Studio 2010 IDE&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Simplifying the problem: plain vanilla configuration</title><link>http://www.manusoft.com/archive/blog/simplifying-the-problem-plain-vanilla-configuration/</link><pubDate>Sat, 26 Feb 2011 14:21:32 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/simplifying-the-problem-plain-vanilla-configuration/</guid><description>&lt;p&gt;One of the stages in &lt;a href="http://otb.manusoft.com/2011/02/the-art-of-simplifying-the-problem.htm"&gt;simplifying an AutoCAD software problem&lt;/a&gt; is to rule out (or in) third party add-ons as the cause. To do that, you&amp;rsquo;ll need a &amp;ldquo;plain vanilla&amp;rdquo; test bed configuration that consists of only the out-of-the-box components with no add-ons loaded.&lt;/p&gt;</description></item><item><title>Simplifying the problem: divide and conquer</title><link>http://www.manusoft.com/archive/blog/simplifying-the-problem-divide-and-conquer/</link><pubDate>Fri, 25 Feb 2011 14:08:51 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/simplifying-the-problem-divide-and-conquer/</guid><description>&lt;p&gt;When a customer reports a &lt;a href="http://otb.manusoft.com/2011/02/is-it-the-drawing.htm"&gt;drawing-specific issue&lt;/a&gt;, the next stage in &lt;a href="http://otb.manusoft.com/2011/02/the-art-of-simplifying-the-problem.htm"&gt;simplifying the problem&lt;/a&gt; is to eliminate all drawing content that has no bearing on the problem. Unless the drawing object that causes the problem is obvious and can be immediately ascertained, I use the &lt;a href="http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm"&gt;divide-and-conquer&lt;/a&gt; method to zero in on the cause.&lt;/p&gt;</description></item><item><title>The art of simplifying the problem</title><link>http://www.manusoft.com/archive/blog/the-art-of-simplifying-the-problem/</link><pubDate>Wed, 23 Feb 2011 14:06:57 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/the-art-of-simplifying-the-problem/</guid><description>&lt;p&gt;One of the most important skills in resolving technical problems is not problem solving, but problem definition. Stripping a problem down to its essence often makes the solution obvious. I think this is generally true, but especially true in my experience with software tech support and tracking down software bugs.&lt;/p&gt;</description></item><item><title>Visual Studio 2010 Migration Post Mortem</title><link>http://www.manusoft.com/archive/blog/visual-studio-2010-migration-post-mortem/</link><pubDate>Mon, 18 Oct 2010 23:49:22 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/visual-studio-2010-migration-post-mortem/</guid><description>&lt;p&gt;I have more or less completed the task of migrating my internal projects to Visual Studio 2010. Native C++ programmers are pretty low on the totem pole of programming coolness these days, but Microsoft did throw us a few bones. At this point I have to say I&amp;rsquo;m ambivalent overall with VS 2010, but I really like some of the architectural changes and I&amp;rsquo;m excited about the future.&lt;/p&gt;</description></item><item><title>Visual Studio 2010 Native Multi-Targeting</title><link>http://www.manusoft.com/archive/blog/visual-studio-2010-native-multi-targeting/</link><pubDate>Thu, 07 Oct 2010 02:16:19 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/visual-studio-2010-native-multi-targeting/</guid><description>&lt;p&gt;I was hoping that Microsoft would address &lt;a href="http://otb.manusoft.com/2010/01/visual-studio-2010-and-vc-build-hook.htm"&gt;the need to target earlier versions of Visual Studio&lt;/a&gt; within the Visual Studio 2010 IDE, but since &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/570466/vs-2010-native-build-cannot-produce-ansi-response-files"&gt;they decided to punt&lt;/a&gt;, I tackled the problem myself. I&amp;rsquo;ve released my solution as an open source project named &lt;a href="http://daffodil.codeplex.com/"&gt;Daffodil for Visual Studio&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Missing Language Pack DWG File Repair</title><link>http://www.manusoft.com/archive/blog/missing-language-pack-dwg-file-repair/</link><pubDate>Thu, 22 Jul 2010 00:11:46 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/missing-language-pack-dwg-file-repair/</guid><description>&lt;p&gt;I &lt;a href="http://otb.manusoft.com/2009/08/autocad-anguage-pack-drawing-file.htm"&gt;wrote before&lt;/a&gt; about corrupt text causing bogus &amp;ldquo;Missing Language Pack&amp;rdquo; warnings in AutoCAD. That case prompted me to write a file repair utility. However, since the case appeared to be isolated, I never released the utility to the public.&lt;/p&gt;
&lt;p&gt;The problem has been &lt;a href="http://www.blog.cadnauseam.com/2010/07/22/partial-fix-for-language-pack-problem/"&gt;rearing its ugly head again&lt;/a&gt;, so I decided to dust off the original code and release it. The repair utility is now available on the &lt;a href="http://www.manusoft.com/software/freebies/arx.html"&gt;freebies page&lt;/a&gt; (look for CleanLanguage.zip) for AutoCAD 2007 and later versions of AutoCAD. I have not tested any recent cases, so I can&amp;rsquo;t be sure it is the same problem. If you try the utility, please report your results by leaving a comment here.&lt;/p&gt;</description></item><item><title>Using VC 7 build tools in Visual Studio 2010</title><link>http://www.manusoft.com/archive/blog/using-vc-7-build-tools-in-visual-studio-2010/</link><pubDate>Thu, 24 Jun 2010 16:13:38 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/using-vc-7-build-tools-in-visual-studio-2010/</guid><description>&lt;p&gt;&lt;em&gt;[Update: See &lt;/em&gt;&lt;a href="http://otb.manusoft.com/2010/10/visual-studio-2010-native-multi-targeting.htm"&gt;&lt;em&gt;Visual Studio 2010 Native Multi-Targeting&lt;/em&gt;&lt;/a&gt;&lt;em&gt;]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Developers, if you use &lt;a href="http://www.manusoft.com/resources/arxtips/vcbuildhook.html"&gt;VC Build Hook&lt;/a&gt; and/or need the same capability in Visual Studio 2010, please let Microsoft know by &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/570466/vs-2010-native-build-cannot-produce-ansi-response-files"&gt;voting for a fix&lt;/a&gt;. I&amp;rsquo;ve &lt;a href="http://otb.manusoft.com/2010/01/visual-studio-2010-and-vc-build-hook.htm"&gt;written before&lt;/a&gt; (and &lt;a href="http://otb.manusoft.com/2010/04/visual-studio-2010-ships.htm"&gt;here&lt;/a&gt;) about the problem. I think it is possible to hack a third party solution, but by far the best solution is for Microsoft to add back the ability to produce ANSI response files in service pack 1.&lt;/p&gt;</description></item><item><title>GlowCode Success Story</title><link>http://www.manusoft.com/archive/blog/glowcode-success-story/</link><pubDate>Sat, 12 Jun 2010 18:56:33 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/glowcode-success-story/</guid><description>&lt;p&gt;I use &lt;a href="http://www.glowcode.com"&gt;GlowCode&lt;/a&gt; for profiling ObjectARX applications. As far as I know, this is the only profiler that works with AutoCAD. What makes GlowCode special is that it can instrument code on the fly, including a monster like AutoCAD. It has a clunky interface that takes some patience to figure out, but it&amp;rsquo;s a lifesaver when you need it.&lt;/p&gt;</description></item><item><title>Bricsys 2010 Developer Conference Post Mortem</title><link>http://www.manusoft.com/archive/blog/bricsys-2010-developer-conference-post-mortem/</link><pubDate>Fri, 11 Jun 2010 17:09:02 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/bricsys-2010-developer-conference-post-mortem/</guid><description>&lt;p&gt;I am back home after a whirlwind trip to the &lt;a href="http://www.bricsys.com/conference/"&gt;Bricsys 2010 Conference&lt;/a&gt;. I&amp;rsquo;m very happy to be back to Ohio food and my own bed. It was a great experience and well worth the trouble.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve &lt;a href="http://otb.manusoft.com/2007/12/au-2007-post-mortem.htm"&gt;written before&lt;/a&gt; (and &lt;a href="http://www.manusoft.com/resources/anecdotes/au97.html"&gt;here&lt;/a&gt;) about the problem with food at conferences, and this one was no different. Unfortunately, there are no Burger Kings in Belgium, so the problem was compounded. I was excited when I saw a restaurant touting &amp;ldquo;American Food&amp;rdquo;, unfortunately it was &amp;ldquo;American Food as Europeans Imagine It&amp;rdquo;, which is not American food at all.&lt;/p&gt;</description></item><item><title>Visual Studio 2010 Ships</title><link>http://www.manusoft.com/archive/blog/visual-studio-2010-ships/</link><pubDate>Mon, 12 Apr 2010 20:34:40 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/visual-studio-2010-ships/</guid><description>&lt;p&gt;Visual Studio 2010 &lt;a href="http://blogs.msdn.com/visualstudio/archive/2010/04/12/visual-studio-2010-is-now-available.aspx"&gt;shipped today&lt;/a&gt; accompanied by .NET Framework 4.0. I blogged before about the switch to using the MSBuild build system, and how that theoretically could be helpful in targeting multiple AutoCAD versions from the same solution. The shipping VS 2010 does not support non-Unicode response files, so out-of-the-box it cannot target VC 7.0 (for AutoCAD 2006 and earlier). When time permits, I&amp;rsquo;m planning to see if I can find a workaround; in the meantime, I&amp;rsquo;ll continue to use VS 2008 for ObjectARX.&lt;/p&gt;</description></item><item><title>Port Your ObjectARX Code to 64 Bit</title><link>http://www.manusoft.com/archive/blog/port-your-objectarx-code-to-64-bit/</link><pubDate>Thu, 11 Mar 2010 23:08:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/port-your-objectarx-code-to-64-bit/</guid><description>&lt;p&gt;AutoCAD versions since AutoCAD 2008 (and since AutoCAD LT 2009) have included both 32 bit and 64 bit flavors on the same media. If you install on a 64 bit Windows system, you get the 64 bit AutoCAD; otherwise you get the 32 bit AutoCAD. The 64 bit AutoCAD can take advantage of as much memory as you can throw at it, whereas the 32 bit version is limited to 2 GB (3 GB if you cheat). They should be otherwise identical in theory, but in practice there are major differences.&lt;br /&gt;&lt;br /&gt;One big difference is VBA. Microsoft put VBA out to pasture many years ago when they introduced the .NET framework, so there will never be a 64 bit version of VBA. Autodesk had to resort to a seriously inefficient kludge to get it to work at all in the 64 bit flavor of AutoCAD (VBA has to run in a separate 32 bit process, which makes typical applications two orders of magnitude slower).&lt;br /&gt;&lt;br /&gt;The other big difference is that any third party ObjectARX applications must be installed for the correct architecture. A 32 bit ObjectARX application will not work in a 64 bit AutoCAD. [Note that .NET (or &amp;ldquo;managed&amp;rdquo;) applications typically work fine in both architectures &amp;ndash; I&amp;rsquo;m referring to native C++ ObjectARX applications only.]&lt;br /&gt;&lt;br /&gt;On the Autodesk discussion groups, many people ask how they can install the 32 bit version of AutoCAD on their new 64 bit operating system. Why would they want to do that? Almost always because they need to use an application that is only available for 32 bit AutoCAD architectures, or because they discover that their VBA applications become unbearably slow.&lt;br /&gt;&lt;br /&gt;It is possible, with some hacking of the AutoCAD installation database, to install the 32 bit flavor of AutoCAD on a 64 bit system, but I don&amp;rsquo;t recommend that. There is just no excuse any more to not support the 64 bit architecture. If you find yourself in this situation, put pressure on the developer of the application to get it ported.&lt;br /&gt;&lt;br /&gt;In fact, if you rely on an application that hasn&amp;rsquo;t been ported to the 64 bit architecture, I&amp;rsquo;d like to hear from you. Add a comment to this post and let me know the name of the application. If you are a vendor or developer that has not yet ported your 32 bit application, please &lt;a href="mailto:owenw@manusoft.com"&gt;contact me&lt;/a&gt; &amp;ndash; I will gladly port it for you. Even large applications can typically be ported in several hours.&lt;br /&gt;&lt;br /&gt;BTW, I am well aware that even Autodesk is guilty of not supporting 64 bit platforms in some of its vertical market AutoCAD versions (and corresponding object enablers). I certainly hope they remedy that situation in the next release cycle.&lt;/p&gt;</description></item><item><title>Visual Studio 2010 and VC Build Hook</title><link>http://www.manusoft.com/archive/blog/visual-studio-2010-and-vc-build-hook/</link><pubDate>Mon, 11 Jan 2010 20:32:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/visual-studio-2010-and-vc-build-hook/</guid><description>&lt;p&gt;&lt;em&gt;[Update: See &lt;/em&gt;&lt;a href="http://otb.manusoft.com/2010/10/visual-studio-2010-native-multi-targeting.htm"&gt;&lt;em&gt;Visual Studio 2010 Native Multi-Targeting&lt;/em&gt;&lt;/a&gt;&lt;em&gt;]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Many of you use my &lt;a href="http://www.manusoft.com/resources/arxtips/vcbuildhook.html"&gt;VC Build Hook utility&lt;/a&gt; to target multiple versions of AutoCAD from a single solution in Visual Studio 2008. Visual Studio 2010 now includes a new feature called &lt;a href="http://blogs.msdn.com/vcblog/archive/2009/12/08/c-native-multi-targeting.aspx"&gt;native multi-targeting&lt;/a&gt; that performs the same function as VC Build Hook. The new feature works great for using build tools back to VC 7.1, but it does not work with VC 7, which is required for targeting AutoCAD versions 2006 and earlier.&lt;/p&gt;</description></item><item><title>Automatic LISP Loading</title><link>http://www.manusoft.com/archive/blog/automatic-lisp-loading/</link><pubDate>Thu, 24 Dec 2009 12:12:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/automatic-lisp-loading/</guid><description>&lt;p&gt;There are a myriad of ways to load AutoLISP applications in AutoCAD, including acaddoc.lsp, an .mnl file, the Startup Suite, and manually by various means. For application developers wishing to deploy their applications to others, all of these methods have drawbacks. The ideal solution should be easy to implement in an installation program, require minimal or zero changes to the user&amp;rsquo;s AutoCAD configuration, work the same way across all versions of AutoCAD, and easily undone when the application is uninstalled.&lt;/p&gt;</description></item><item><title>ArxDbg Utility</title><link>http://www.manusoft.com/archive/blog/arxdbg-utility/</link><pubDate>Wed, 23 Sep 2009 18:31:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/arxdbg-utility/</guid><description>&lt;p&gt;ArxDbg is the name of a sample project that has been included with the ObjectARX SDK for many years. It&amp;rsquo;s primary purpose is to demonstrate how to use the ObjectARX API, but it is a complete free-standing utility in its own right. ObjectARX programmers often use this utility during development for testing and exercising their application code, but it can be useful to anybody, not just programmers.&lt;/p&gt;</description></item><item><title>ObjectARX 2010: Dealing With Missing Exports</title><link>http://www.manusoft.com/archive/blog/objectarx-2010-dealing-with-missing/</link><pubDate>Sat, 28 Mar 2009 16:54:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/objectarx-2010-dealing-with-missing/</guid><description>&lt;p&gt;In the new ObjectARX 2010 SDK, Autodesk has added some new virtual member functions that are not exported as they should be. For example, the AcGiFaceData class has had two new virtual functions added for setting and getting the face transparency:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color:#990000;"&gt;class&lt;/span&gt; AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; public&lt;/span&gt; AcRxObject&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/b&gt;&lt;i&gt;&lt;span style="color:#999999;"&gt;&lt;br /&gt;//[&amp;hellip; deleted for brevity]&lt;br /&gt;&lt;/span&gt;&lt;/i&gt; ACDB_PORT&lt;span style="color:#990000;"&gt; virtual&lt;/span&gt; AcDbObjectId&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;em&gt;&lt;/span&gt;&lt;/b&gt; materials&lt;b&gt;&lt;span style="color:#663300;"&gt;()&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; ACDB_PORT&lt;span style="color:#990000;"&gt; virtual&lt;/span&gt; AcGiMapper&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; mappers&lt;b&gt;&lt;span style="color:#663300;"&gt;()&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt; virtual&lt;/span&gt;&lt;span style="color:#ff6633;"&gt; void&lt;/span&gt; setTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;const&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; &lt;em&gt;&lt;/span&gt;&lt;/b&gt;transparency&lt;b&gt;&lt;span style="color:#663300;"&gt;);&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; virtual&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; transparency&lt;b&gt;&lt;span style="color:#663300;"&gt;()&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt;&lt;/strong&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt;private&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; AcGiImpFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt; &lt;em&gt;&lt;/span&gt;&lt;/b&gt;mpAcGiImpFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;br /&gt;};&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;As you can see, whoever added the new functions neglected to prefix them with the ACDB_PORT macro. ACDB_PORT evaluates to __declspec(export), which tells the compiler to export the function. Since the macro is missing, the new functions are not exported from acdb18.dll.&lt;br /&gt;&lt;br /&gt;Since these are virtual functions, you won&amp;rsquo;t have any problems calling them through a pointer to an AcGiFaceData object that was constructed by AutoCAD. The problem arises when you derive a class from AcGiFaceData. Since the functions are not exported, the linker has no way of resolving their address for creating the virtual function table of your derived class. This results in linker errors:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;acrxEntryPoint.obj : error LNK2001: unresolved external symbol &amp;ldquo;public: virtual void __thiscall AcGiFaceData::setTransparency(class AcCmTransparency const &lt;em&gt;)&amp;rdquo; (?setTransparency@AcGiFaceData@@UAEXPBVAcCmTransparency@@@Z)&lt;br /&gt;acrxEntryPoint.obj : error LNK2001: unresolved external symbol &amp;ldquo;public: virtual class AcCmTransparency * __thiscall AcGiFaceData::transparency(void)const &amp;quot; (?transparency@AcGiFaceData@@UBEPAVAcCmTransparency@@XZ)&lt;/blockquote&gt;Following is an example that results in these errors:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color:#990000;"&gt;class&lt;/span&gt; AcGiFaceDataEx&lt;b&gt;&lt;span style="color:#663300;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; public&lt;/span&gt; AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt;public&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; AcGiFaceDataEx&lt;b&gt;&lt;span style="color:#663300;"&gt;() {}&lt;br /&gt; ~&lt;/span&gt;&lt;/b&gt;AcGiFaceDataEx&lt;b&gt;&lt;span style="color:#663300;"&gt;() {}&lt;br /&gt;}&lt;/span&gt;&lt;/b&gt; Test&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The only solution is to provide an implementation of the missing functions. In this case, it could be accomplished by something like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color:#990000;"&gt;class&lt;/span&gt; AcGiFaceDataEx&lt;b&gt;&lt;span style="color:#663300;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; public&lt;/span&gt; AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; mpTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt;public&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; AcGiFaceDataEx&lt;b&gt;&lt;span style="color:#663300;"&gt;() :&lt;/span&gt;&lt;/b&gt; mpTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; NULL&lt;b&gt;&lt;span style="color:#663300;"&gt; ) {}&lt;br /&gt; ~&lt;/span&gt;&lt;/b&gt;AcGiFaceDataEx&lt;b&gt;&lt;span style="color:#663300;"&gt;() {&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; delete&lt;/span&gt; mpTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;; }&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; virtual&lt;/span&gt;&lt;span style="color:#ff6633;"&gt; void&lt;/span&gt; setTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;const&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; &lt;em&gt;&lt;/span&gt;&lt;/b&gt;transparency&lt;b&gt;&lt;span style="color:#663300;"&gt;)&lt;br /&gt; {&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; delete&lt;/span&gt; mpTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; mpTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; = (&lt;/span&gt;&lt;/b&gt;transparency&lt;b&gt;&lt;span style="color:#663300;"&gt;?&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; new&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;( &lt;em&gt;&lt;/span&gt;&lt;/b&gt;transparency&lt;b&gt;&lt;span style="color:#663300;"&gt; ) :&lt;/span&gt;&lt;/b&gt; NULL&lt;b&gt;&lt;span style="color:#663300;"&gt;);&lt;br /&gt; }&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; virtual&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; transparency&lt;b&gt;&lt;span style="color:#663300;"&gt;()&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt; {&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt; return&lt;/span&gt; mpTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;; }&lt;br /&gt;}&lt;/span&gt;&lt;/b&gt; Test&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;This will fix the linker errors, but there is no guarantee that it will work as intended. AutoCAD might access its internal transparency value directly without calling through the member functions, which means it would never &amp;ldquo;see&amp;rdquo; the transparency set through the replacement member functions. Furthermore, the addition of the new pointer member changes the size of the class, which causes AcGiFaceDataEx arrays to have a different memory footprint than AcGiFaceData arrays. Lastly, what if Autodesk fixes the problem in a future AutoCAD service pack?&lt;br /&gt;&lt;br /&gt;The ideal solution should not change the size of the class. It should check at runtime whether the function is exported, then use the exported function if it exists. That way, code that is written now will use the exported function if and when it becomes available in a future version of AutoCAD. When the function is not exported, an alternate implementation must be provided. This is not an unusual scenario, and the solution I present for the specific case of AcGiFaceData can be adapted to the more general problem.&lt;br /&gt;&lt;br /&gt;In the AcGiFaceData case, the missing functions are virtual functions. Knowing this, it is possible to use a trick to get the address of the real function. In the code below, the function getAcGiFaceData_vtable() constructs a temporary AcGiFaceData object, from which it extracts a pointer to the object&amp;rsquo;s virtual function table. The virtual function table is just an array of function pointers, so the address of the desired function can be obtained by indexing into the virtual function table. The question is, how far? By counting virtual functions and data members starting from the top of the class hierarchy: in this case, 6 virtual functions in AcRxObject plus 16 virtual functions in AcGiFaceData = 22.&lt;br /&gt;&lt;br /&gt;Note that obtaining a function pointer this way relies on Visual C++ implementation details, but this is safe to do since all ObjectARX modules must be compiled in Visual C++.&lt;br /&gt;&lt;br /&gt;Following is my solution to the missing AcGiFaceData functions:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color:#000099;"&gt;#pragma warning(push)&lt;br /&gt;#pragma warning(disable: 4608)&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;template&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt; &amp;lt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; typename&lt;/span&gt; Src&lt;b&gt;&lt;span style="color:#663300;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; typename&lt;/span&gt; Dest&lt;b&gt;&lt;span style="color:#663300;"&gt; &amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Dest force_cast&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; Src src&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;br /&gt;{&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; union&lt;/span&gt; _convertor&lt;b&gt;&lt;span style="color:#663300;"&gt; {&lt;/span&gt;&lt;/b&gt; Dest d&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt; Src s&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt; _convertor&lt;b&gt;&lt;span style="color:#663300;"&gt;() :&lt;/span&gt;&lt;/b&gt; d&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#999900;"&gt;0&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;),&lt;/span&gt;&lt;/b&gt; s&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#999900;"&gt;0&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;) {} }&lt;/span&gt;&lt;/b&gt; convertor&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; convertor&lt;b&gt;&lt;span style="color:#663300;"&gt;.&lt;/span&gt;&lt;/b&gt;s&lt;b&gt;&lt;span style="color:#663300;"&gt; =&lt;/span&gt;&lt;/b&gt; src&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; return&lt;/span&gt; convertor&lt;b&gt;&lt;span style="color:#663300;"&gt;.&lt;/span&gt;&lt;/b&gt;d&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000099;"&gt;&lt;br /&gt;#pragma warning(pop)&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt;static&lt;/span&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; getAcGiFaceData_vtable&lt;b&gt;&lt;span style="color:#663300;"&gt;()&lt;br /&gt;{&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; static&lt;/span&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt; = &lt;em&gt;(&lt;/span&gt;&lt;/b&gt;FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;**)&amp;amp;&lt;/span&gt;&lt;/b&gt;AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;();&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; return&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt; (&lt;/span&gt;&lt;/b&gt;rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt;?&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt; :&lt;/span&gt;&lt;/b&gt; NULL&lt;b&gt;&lt;span style="color:#663300;"&gt;);&lt;br /&gt;}&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff6633;"&gt;&lt;br /&gt;&lt;br /&gt;void&lt;/span&gt; AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;::&lt;/span&gt;&lt;/b&gt;setTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; transparency&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;br /&gt;{&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; typedef&lt;/span&gt;&lt;span style="color:#ff6633;"&gt; void&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt; (&lt;/span&gt;&lt;/b&gt;AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;::&lt;em&gt;&lt;/span&gt;&lt;/b&gt;F_setTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;)(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt; );&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; static&lt;/span&gt; F_setTransparency pfSetTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; =&lt;/span&gt;&lt;/b&gt; force_cast&lt;b&gt;&lt;span style="color:#663300;"&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;,&lt;/span&gt;&lt;/b&gt; F_setTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; &amp;gt;(&lt;/span&gt;&lt;/b&gt;GetProcAddress&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; GetModuleHandleA&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#009900;"&gt; &amp;ldquo;acdb18.dll&amp;rdquo;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#009900;"&gt; &amp;ldquo;?setTransparency@AcGiFaceData@@UEAAXPEBVAcCmTransparency@@@Z&amp;rdquo;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt; ));&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; if&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;( !&lt;/span&gt;&lt;/b&gt;pfSetTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;br /&gt; {&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; static&lt;/span&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;em&gt;&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt; =&lt;/span&gt;&lt;/b&gt; getAcGiFaceData_vtable&lt;b&gt;&lt;span style="color:#663300;"&gt;();&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; if&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; pfSetTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; =&lt;/span&gt;&lt;/b&gt; force_cast&lt;b&gt;&lt;span style="color:#663300;"&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;,&lt;/span&gt;&lt;/b&gt; F_setTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; &amp;gt;(&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt;[&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#999900;"&gt;22&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;] );&lt;br /&gt; }&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; if&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; pfSetTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;br /&gt; (&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;this&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;-&amp;gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt;pfSetTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;)(&lt;/span&gt;&lt;/b&gt; transparency&lt;b&gt;&lt;span style="color:#663300;"&gt; );&lt;br /&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;em&gt;&lt;/span&gt;&lt;/b&gt; AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;::&lt;/span&gt;&lt;/b&gt;transparency&lt;b&gt;&lt;span style="color:#663300;"&gt;()&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;br /&gt;{&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; typedef&lt;/span&gt; AcCmTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt; (&lt;/span&gt;&lt;/b&gt;AcGiFaceData&lt;b&gt;&lt;span style="color:#663300;"&gt;::&lt;em&gt;&lt;/span&gt;&lt;/b&gt;F_transparency&lt;b&gt;&lt;span style="color:#663300;"&gt;)()&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt; const&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; static&lt;/span&gt; F_transparency pfTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; =&lt;/span&gt;&lt;/b&gt; force_cast&lt;b&gt;&lt;span style="color:#663300;"&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;,&lt;/span&gt;&lt;/b&gt; F_transparency&lt;b&gt;&lt;span style="color:#663300;"&gt; &amp;gt;(&lt;/span&gt;&lt;/b&gt;GetProcAddress&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; GetModuleHandleA&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#009900;"&gt; &amp;ldquo;acdb18.dll&amp;rdquo;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#009900;"&gt; &amp;ldquo;?transparency@AcGiFaceData@@UEBAPEAVAcCmTransparency@@XZ&amp;rdquo;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt; ));&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; if&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;( !&lt;/span&gt;&lt;/b&gt;pfTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;br /&gt; {&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;&lt;br /&gt; static&lt;/span&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt; =&lt;/span&gt;&lt;/b&gt; getAcGiFaceData_vtable&lt;b&gt;&lt;span style="color:#663300;"&gt;();&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; if&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;/span&gt;&lt;/b&gt;&lt;br /&gt; pfTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; =&lt;/span&gt;&lt;/b&gt; force_cast&lt;b&gt;&lt;span style="color:#663300;"&gt;&amp;lt;&lt;/span&gt;&lt;/b&gt; FARPROC&lt;b&gt;&lt;span style="color:#663300;"&gt;,&lt;/span&gt;&lt;/b&gt; F_transparency&lt;b&gt;&lt;span style="color:#663300;"&gt; &amp;gt;(&lt;/span&gt;&lt;/b&gt; rfVTable&lt;b&gt;&lt;span style="color:#663300;"&gt;[&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#999900;"&gt;23&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;] );&lt;br /&gt; }&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; if&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;(&lt;/span&gt;&lt;/b&gt; pfTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt; )&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; return&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt; (&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#990000;"&gt;this&lt;/span&gt;&lt;b&gt;&lt;span style="color:#663300;"&gt;-&amp;gt;*&lt;/span&gt;&lt;/b&gt;pfTransparency&lt;b&gt;&lt;span style="color:#663300;"&gt;)();&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#ff0000;"&gt;&lt;br /&gt; return&lt;/span&gt; NULL&lt;b&gt;&lt;span style="color:#663300;"&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/p&gt;</description></item><item><title>Debugging ObjectARX: Break on Exception</title><link>http://www.manusoft.com/archive/blog/debugging-objectarx-break-on-exception/</link><pubDate>Mon, 12 May 2008 11:11:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/debugging-objectarx-break-on-exception/</guid><description>&lt;p&gt;I have presented a class entitled High Octane ObjectARX at &lt;a href="http://au.autodesk.com/event/"&gt;Autodesk University&lt;/a&gt; the past two years. In 2006 the focus was on project organization, and last year I focused more on techniques for supporting multiple versions of AutoCAD with a single Visual Studio solution, touching briefly on testing and profiling. For 2008 I plan to focus on debugging.&lt;/p&gt;</description></item><item><title>The Day the ObjectARX SDK Died</title><link>http://www.manusoft.com/archive/blog/day-objectarx-sdk-died/</link><pubDate>Thu, 27 Mar 2008 15:09:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/day-objectarx-sdk-died/</guid><description>&lt;p&gt;Like &lt;a href="http://en.wikipedia.org/wiki/The_Day_the_Music_Died"&gt;that day almost 50 years ago&lt;/a&gt;, could today be the day that ObjectARX has died?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There have been a &lt;a href="http://discussion.autodesk.com/thread.jspa?threadID=652855"&gt;flurry of posts&lt;/a&gt; in the ObjectARX discussion group about problems downloading the new ObjectARX 2009 SDK. At first I dismissed the problems as new release hiccups, and expected things to get resolved in short order. Seeing that there were no new complaints this morning, I headed over to &lt;a href="http://www.objectarx.com/"&gt;http://www.objectarx.com/&lt;/a&gt; to download the new ObjectARX 2009 SDK. Instead of the new ObjectARX 2009 SDK, I received the following:&lt;br /&gt;&lt;a href="http://otb.manusoft.com/files/SDK_Request.png"&gt;&lt;img style="CURSOR: hand" alt="" src="http://otb.manusoft.com/files/SDK_Request.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>AU 2007 Post Mortem</title><link>http://www.manusoft.com/archive/blog/au-2007-post-mortem/</link><pubDate>Mon, 03 Dec 2007 15:12:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/au-2007-post-mortem/</guid><description>&lt;p&gt;The Hot List&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Carl Bass munching on fast food in the food court, and spotted throughout the week yakking with average folks in the halls.&lt;/li&gt;&lt;li&gt;Staggered classes reduced the lunchtime crush experienced at AU 2006.&lt;/li&gt;&lt;li&gt;More ObjectARX programming classes this year. I&amp;rsquo;m pushing for creating a new &amp;ldquo;Developer&amp;rdquo; track for AU 2008.&lt;/li&gt;&lt;li&gt;The &lt;a href="http://www.flickr.com/photos/btl/2077673044/"&gt;Matt Murphy Head&lt;/a&gt; (peace be upon him).&lt;/li&gt;&lt;li&gt;Meeting a lot of familiar faces and a few new ones!&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The Cold List&lt;/p&gt;</description></item><item><title>VC Build Hook utility for Visual Studio 2008</title><link>http://www.manusoft.com/archive/blog/vc-build-hook-utility-for-visual-studio/</link><pubDate>Mon, 26 Nov 2007 02:27:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/vc-build-hook-utility-for-visual-studio/</guid><description>&lt;p&gt;The new&lt;a href="http://msdn2.microsoft.com/vs2008/products/"&gt; Visual Studio 2008&lt;/a&gt; has been released, and to celebrate, I&amp;rsquo;ve updated &lt;a href="http://www.manusoft.com/resources/arxtips/vcbuildhook.html"&gt;VC Build Hook&lt;/a&gt;. The updated utility allows you to use the new IDE while still building with older versions of the build tools.&lt;br /&gt;&lt;br /&gt;Why is this necessary? If you build your AutoCAD 2007/2008 ObjectARX application with the Visual C/C++ 9.0 tools, AutoCAD will display a warning message about an incompatible module when you try to load it. You can use VC Build Hook to target all previous AutoCAD versions from a single Visual Studio 2008 solution (if you have the correct version of Visual C/C++ installed alongside Visual Studio 2008).&lt;br /&gt;&lt;br /&gt;In my testing so far, existing Visual Studio 2005 projects build without problems in Visual Studio 2008 when VC Build Hook is installed and the new &amp;lsquo;BuildToolVersion&amp;rsquo; property is set to the correct version.&lt;/p&gt;</description></item><item><title>Visual Studio Build Configuration Tip</title><link>http://www.manusoft.com/archive/blog/visual-studio-build-configuration-tip/</link><pubDate>Fri, 15 Jun 2007 12:30:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/visual-studio-build-configuration-tip/</guid><description>&lt;p&gt;I&amp;rsquo;ve received several emails recently from users of my &lt;a href="http://www.manusoft.com/resources/arxtips/vcbuildhook.html"&gt;VC Build Hook utility&lt;/a&gt; that mention switching the &amp;lsquo;UseVC7Paths&amp;rsquo; setting on and off depending on the build configuration they are working on. If you are doing this, you need to change your project structure!&lt;/p&gt;</description></item><item><title>My ManuSoft manifest manifesto</title><link>http://www.manusoft.com/archive/blog/my-manusoft-manifest-manifesto/</link><pubDate>Thu, 11 Jan 2007 13:10:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/my-manusoft-manifest-manifesto/</guid><description>&lt;p&gt;With the advent of Visual Studio 2005 and automatically generated manifest files, the topic of when and how to use manifest files comes up occasionally. Since a default ObjectARX wizard generated project in Visual Studio 2005 generates an embedded manifest by default, most people don&amp;rsquo;t even think about it. Of course that was the whole idea &amp;ndash; the manifest would ensure that the correct dependent DLLs get loaded, and voila, no &lt;em&gt;need&lt;/em&gt; to think about it. One of my programming axioms applies in this case: &lt;a href="http://en.wikipedia.org/wiki/TANSTAAFL"&gt;TANSTAAFL&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The problem is that ObjectARX applications are not in charge. AutoCAD is in charge, and it will decide which VC runtime and MFC runtime DLLs to load. If your ObjectARX application loads a different VC or MFC runtime than the ones AutoCAD is using, you&amp;rsquo;ll encounter big problems. I&amp;rsquo;ve always advised disabling the manifest completely (see my &lt;a href="http://www.manusoft.com/resources/arxtips/vcbuildhook.html"&gt;ObjectARX Tips&lt;/a&gt; page) to avoid such a possibility. Unfortunately, there&amp;rsquo;s a catch.&lt;br /&gt;&lt;br /&gt;The problem is that linking to the ATL80.DLL file isn&amp;rsquo;t possible by just disabling the manifest and doing nothing more. ATL is now a side-by-side (SxS) assembly, and it no longer lives on the Windows support path, so a standard un-manifested DLL won&amp;rsquo;t be able to find it. The preferred solution is to link statically to ATL (see Configuration -&amp;gt; General -&amp;gt; &amp;lsquo;Use of ATL&amp;rsquo; in VS 2005 project properties) and avoid the problem altogether. If you only have one module that uses ATL, this is always the best solution.&lt;br /&gt;&lt;br /&gt;The less desirable solution is to add a &lt;strong&gt;&lt;em&gt;manually-created&lt;/em&gt;&lt;/strong&gt; manifest that specifies the desired ATL SxS assembly, but ignores the VC and MFC runtime DLLs. You&amp;rsquo;ll still need to decide whether to make ATL &lt;a href="http://msdn2.microsoft.com/en-us/library/ms235531.aspx"&gt;shared or private&lt;/a&gt;, and in either case you &lt;strong&gt;&lt;em&gt;must&lt;/em&gt;&lt;/strong&gt; &lt;a href="http://msdn2.microsoft.com/en-us/library/ms235299(VS.80).aspx"&gt;distribute ATL with your application&lt;/a&gt; to ensure that it is available when your application is deployed. You can cheat, and let VS generate your manifest file (instruct it to &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; embed the file), then just edit the resulting .manifest file to remove references to the VC and MFC assemblies. For example, here&amp;rsquo;s one that I generated (you&amp;rsquo;ll need to generate your own to ensure that the manifest matches the version you are redistributing):&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;ldquo;1.0&amp;rdquo; encoding=&amp;ldquo;UTF-8&amp;rdquo; standalone=&amp;ldquo;yes&amp;rdquo;?&amp;gt;&lt;br /&gt; &amp;lt;assembly xmlns=&amp;ldquo;urn:schemas-microsoft-com:asm.v1&amp;rdquo; manifestversion=&amp;ldquo;1.0&amp;rdquo;&amp;gt;&lt;br /&gt; &amp;lt;dependency&amp;gt;&lt;br /&gt; &amp;lt;dependentassembly&amp;gt;&lt;br /&gt; &amp;lt;assemblyidentity type=&amp;ldquo;win32&amp;rdquo; name=&amp;ldquo;Microsoft.VC80.ATL&amp;rdquo; version=&amp;ldquo;8.0.50727.762&amp;rdquo; processorarchitecture=&amp;ldquo;x86&amp;rdquo; publickeytoken=&amp;ldquo;1fc8b3b9a1e18e3b&amp;rdquo;&amp;gt;&lt;br /&gt;&amp;lt;/assemblyidentity&amp;gt;&lt;br /&gt; &amp;lt;/dependentassembly&amp;gt;&lt;br /&gt; &amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;/assembly&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;In my work, I&amp;rsquo;ve had very little need for manifests. The VC optimizer is able to strip the unused portions of statically linked ATL out of your code, leaving a much smaller footprint than the entire assembly would require. This eliminates the need to redistribute ATL with your application, thus reducing the overall potential for deployment issues. Nevertheless, there are exceptions to every rule, and your mileage may vary.&lt;/p&gt;</description></item><item><title>VCBuildHook updated for VS 2005 SP1</title><link>http://www.manusoft.com/archive/blog/vcbuildhook-updated-for-vs-2005-sp1/</link><pubDate>Tue, 19 Dec 2006 17:13:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/vcbuildhook-updated-for-vs-2005-sp1/</guid><description>&lt;p&gt;I&amp;rsquo;ve installed &lt;a href="http://otb.manusoft.com/2006/12/visual-studio-2005-service-pack-1-is.htm"&gt;Visual Studio 2005 SP1&lt;/a&gt; and have been busy testing all my projects to make sure they didn&amp;rsquo;t break. &lt;a href="http://www.microsoft.com"&gt;Microsoft&lt;/a&gt; did fix at least one of the bugs I reported (the resource editor choked on resource strings that contained an embedded NULL character), but the IDE still crashes fairly consistently if I initiate a large solution build while the Intellisense database is being rebuilt. SP1 also managed to break my &lt;a href="http://www.manusoft.com/resources/arxtips/vcbuildhook.html"&gt;VCBuildHook utility&lt;/a&gt;, so I&amp;rsquo;ve uploaded an updated version (2.0.3.0) for use with SP1.&lt;/p&gt;</description></item><item><title>Visual Studio 2005 Service Pack 1 is here!</title><link>http://www.manusoft.com/archive/blog/visual-studio-2005-service-pack-1-is/</link><pubDate>Mon, 18 Dec 2006 16:51:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/visual-studio-2005-service-pack-1-is/</guid><description>&lt;p&gt;Finally, the long awaited &lt;a href="http://msdn.microsoft.com/vstudio/support/vs2005sp1"&gt;service pack 1 for Visual Studio 2005&lt;/a&gt; is released! The service pack has been in the pipeline since soon after Visual Studio 2005 shipped last November, with release dates slipping month after month. The latest official release date was announced as &amp;ldquo;early 2007&amp;rdquo;. Perhaps this was an intentional attempt to alleviate some of the waiting pains with a suprise release (or maybe just the Microsoft rumor mill on autopilot).&lt;br /&gt;&lt;br /&gt;Be prepared for a long install. The download page warns that it could take an hour or more to verify digital signatures before the service pack installation even begins.&lt;/p&gt;</description></item><item><title>Visual Studio Version Hunt</title><link>http://www.manusoft.com/archive/blog/visual-studio-version-hunt/</link><pubDate>Fri, 08 Dec 2006 20:06:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/visual-studio-version-hunt/</guid><description>&lt;p&gt;If you&amp;rsquo;ve been programming with ObjectARX for a while, you already know that each version of the &lt;a href="http://www.objectarx.com/"&gt;ObjectARX SDK&lt;/a&gt; only works with a specific version of &lt;a href="http://msdn.microsoft.com/vstudio/"&gt;Visual Studio&lt;/a&gt;. Mazhar Basa touches on the subject in his article &lt;a href="http://www.dailyautocad.com/objectarx/components-of-objectarx-applications/"&gt;Components of ObjectARX Applications&lt;/a&gt;. My &lt;a href="http://www.manusoft.com/resources/arxtips/vcbuildhook.html"&gt;VCBuildHook utility&lt;/a&gt; makes it possible to build for multiple target AutoCAD versions from a single Visual Studio 2005 solution, but this utility still needs the older versions of Visual Studio to be installed on the same system in order to perform its magic.&lt;br /&gt;&lt;br /&gt;The problem is, legitimate licenses of older versions of Visual Studio are hard to come by. Back in the Visual Studio .NET 2003 days, you could purchase a new license of VS 2003, then get a free license downgrade from Microsoft that allowed you to install Visual Studio 2002 side by side on the same system. That combination allowed you to target AutoCAD versions as far back as AutoCAD 2004. Unfortunately, Microsoft stopped offering the VS 2002 downgrade license when Visual Studio 2005 began shipping in November of 2006.&lt;br /&gt;&lt;br /&gt;The end result is that new ObjectARX programmers are faced with a dilemma if they need to target anything older than AutoCAD 2007. One of the attendees at my &amp;ldquo;High-Octane ObjectARX&amp;rdquo; class at &lt;a href="http://au.autodesk.com/"&gt;AU 2006&lt;/a&gt; reminded me that &lt;a href="http://msdn.microsoft.com/"&gt;MSDN&lt;/a&gt; (Microsoft Developer Network) members can download older versions of Visual Studio from the MSDN subscriber download center.&lt;br /&gt;&lt;br /&gt;I have verified that Visual Studio .NET 2002 (VS 2002) is available for download to MSDN Professional subscribers, but I could not find Visual Studio 6.0, which is required to target AutoCAD 2000 - 2002. Visual Studio 4.2 (required for AutoCAD R14) is available though, so maybe I&amp;rsquo;m just not looking in the right place.&lt;br /&gt;&lt;br /&gt;If you are a professional software developer, whether commercial or in-house, you should consider subscribing to &lt;a href="http://msdn.microsoft.com/"&gt;MSDN&lt;/a&gt; for various reasons. If you&amp;rsquo;re an ObjectARX programmer and need to target older versions of AutoCAD, MSDN may be the only way to obtain the older Visual Studio build tools and libraries that you&amp;rsquo;ll need.&lt;/p&gt;</description></item><item><title>Demand Loading a VLX File</title><link>http://www.manusoft.com/archive/blog/demand-loading-vlx-file/</link><pubDate>Mon, 04 Dec 2006 18:34:00 +0000</pubDate><guid>http://www.manusoft.com/archive/blog/demand-loading-vlx-file/</guid><description>&lt;p&gt;Some years ago I wrote a small ObjectARX module named VLXLoad that loads a .vlx file of the same name and in the same directory as the .arx module. I never claimed credit for the utility, but now that I&amp;rsquo;ve &lt;a href="http://www.manusoft.com/resources/arxtips/demandloadvlx.html"&gt;released the source code&lt;/a&gt;, I guess I&amp;rsquo;ll have to own up to it.&lt;/p&gt;</description></item></channel></rss>