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 …

Continue reading ‘Polymorphic bit flags in C++’ »

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”. I check return values religiously, use asserts liberally, and never assume that the implementation …

Continue reading ‘Checking function return values’ »

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 …

Continue reading ‘Registering an ARX/BRX module as a COM server’ »

OpenDCL 6

You may not have noticed, but AutoLISP is still alive and kicking. This is evidenced by the growing community of developers and hobbyist programmers using the latest release of OpenDCL, the free graphical user interface library for AutoLISP applications. If you’re not familiar with OpenDCL, check out the newly released OpenDCL 6. Share ThisTweetFacebookLinkedInTumblrStumbleDiggDelicious

The MFC Balloon

The MFC version that ships with Visual Studio 2010 is known to cause major explosions in file size when you link statically. To avoid that problem, I use the Visual Studio 2008 build tools for such cases. I recently got quite a surprise when I rebuilt one such MFC application and discovered that the executable had ballooned from 400kb to 2MB …

Continue reading ‘The MFC Balloon’ »