Outside The Box blogs, Autodesk University anecdotes, articles, blog digests, and product news in chronological order. See Writing for the same material by subject.

Polymorphic bit flags in C++

· Programming

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

Read

Checking function return values

· Programming

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”. …

Read