Writing a Custom Debugger on Windows

Recently I had to debug an intermittent access violation exception in one of my AutoCAD plug-ins. I needed to get the exception while the debugger was attached so I could break the process and analyze the state of memory before AutoCAD’s global exception handler got control. Unfortunately, sometimes it took several hundred runs before the exception occurred. ...

August 13, 2014 · 3 min · owenwengerd

AutoCAD 2015: Managing the Application Manager

AutoCAD 2015 includes a new feature called Application Manager (http://help.autodesk.com/view/INSTALL_LICENSE/2015/ENU/?guid=GUID-448769B1-CA69-4566-9EAF-D97DBD85AF88). I’m sure it serves a lofty purpose, but it comes across a lot like the slimy Norton and Adobe updaters that are really just Trojans in disguise. It gets installed by default, with no option to prevent installation. To Autodesk’s credit, they do provide instructions for preventing installation of Application Manager (http://help.autodesk.com/view/INSTALL_LICENSE/2015/ENU/?guid=GUID-FAB40CCD-0A6C-4E55-A994-0D237CD954A2), and instructions for removing it after the fact (http://help.autodesk.com/view/INSTALL_LICENSE/2015/ENU/?guid=GUID-D2340FA4-3A0C-4B7C-9558-EB50F6402472). Uninstalling requires several additional clicks, as if they really, really want you to think twice before taking such a drastic measure. ...

March 26, 2014 · 2 min · owenwengerd

Building a commercial grade lisp plugin installer in 5 easy steps

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, OpenDCL 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’s low entry cost, it is not surprising to see lisp continuing to enjoy strong support in the developer community. ...

February 18, 2014 · 4 min · Owen Wengerd

Don't catch what you can't handle

One of the cardinal rules of C++ exception handling is “don’t catch what you can’t handle”. 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’s a good rule of thumb. ...

February 7, 2014 · 1 min · Owen Wengerd

LspLoad now supports Bricscad V14 and ZWCAD+ 2014

I have updated the automatic lisp loader modules (LspLoad.zip on my freebies page) to support Bricscad V14 and ZWCAD+ 2014. Note that the source code for Lspload is also available.

November 1, 2013 · 1 min · Owen Wengerd

LspLoad Updated for AutoCAD 2014 and Bricscad 13 64-bit

The automatic lisp loader modules (LspLoad.zip on my freebies page) 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.

April 13, 2013 · 1 min · Owen Wengerd

Turning off InfoCenter in AutoCAD 2014

The AcadInfoCenterOff.msi file on the ManuSoft Freebies page has been updated to support AutoCAD 2014 based products. Note that you must log out of Autodesk 360 if you disable the InfoCenter, else some versions of AutoCAD will crash during startup.

April 11, 2013 · 1 min · Owen Wengerd

C++ function declaration tips

Creating and calling functions is one of the most fundamental tasks in C++ programming. The function declaration serves as the primary description of a function’s interface - or contract - with callers, thereby making it the most important piece of code documentation. A good function declaration should convey as much information as possible. I’m sure an entire book could be written on the topic of function interface design, but I’ll just touch briefly on a few factors to consider when designing a function’s interface. ...

February 6, 2013 · 4 min · Owen Wengerd

Using /delayload to specify dependent DLL path

Let’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’t load because the dependent DLL cannot be resolved. ...

January 26, 2013 · 2 min · Owen Wengerd

QuirkyPolyline: exposing foolish programmers

In AutoCAD, the AcDbCurve class (http://docs.autodesk.com/ACDMAC/2012/ENU/ObjectARX%20Reference/AcDbCurve.html) defines a general parametrized curve. On a parametrized curve, points in space are mapped to real numbers (parameters) by an arbitrary function F(p) for values of p 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’s one dimensional “parameter space” instead of the more complex three dimensional cartesian space. ...

January 9, 2013 · 4 min · Owen Wengerd

RoboCache for Windows offline files cache management

I’ve written before about RoboCache, a command line utility I wrote for managing the offline files cache in Windows Vista, Windows 7, and now Windows 8. After using the utility internally for a few years, I decided that I might as well clean it up and make it available to the rest of you. RoboCache is now available at the ManuSoft web site. There is a shareware version available, and you can purchase the registered version at the ManuSoft store (cost is 25 USD for a single user license). ...

January 2, 2013 · 4 min · Owen Wengerd

Polymorphic bit flags in C++

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’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. ...

December 19, 2012 · 2 min · Owen Wengerd