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

Checking function return values

A lot of you are guilty of not checking return values from API function calls. I’ll bet you have a good excuse, like “it’s a lot of extra typing for no reason”, or “that function should never return an error code”. ...

August 30, 2012 · 2 min · Owen Wengerd

Turning off InfoCenter (aka WSCommCntr4.exe) in AutoCAD 2013

I have updated the AcadInfoCenterOff.msi file on the ManuSoft Freebies page for AutoCAD 2013. If you’re not sure what it does or why you need it, see this previous post on the subject.

March 28, 2012 · 1 min · Owen Wengerd

Registering an ARX/BRX module as a COM server

If you’re developing ARX modules that need to be registered as a COM server, you’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’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’s doing it at install time under elevated privileges. ...

October 11, 2011 · 3 min · Owen Wengerd