Release Notes

These items are related to this release of ObjectARX and the AutoCAD Managed Classes.

API Compatibility

AutoCAD 2021 is a binary breaking release. ObjectARX applications developed for AutoCAD 2020 and earlier releases must be recompiled before they can be used with AutoCAD 2021-based products.

Development Environment

Microsoft® Visual Studio® 2019 must be used when compiling ObjectARX projects for use with AutoCAD 2021. Applications that require the use of the Microsoft .NET Framework should target the 4.8 version.

Linker

The Linker is *24.lib.

Registry Key

The Registry key has changed from "R23.1" to "R24.0".

32-Bit Application Support

Starting with AutoCAD 2020, 32-bit support is no longer available.

Icon Transparency Support

In AutoCAD 2017 and later, opaque bitmap images that still use RGB 192,192,192 as their background color are no longer supported. It is recommended that these bitmap images should be converted to transparent PNG images.

Changes to AcDbDatabase::saveAs() API

Starting with AutoCAD 2016, DWG files can no longer be saved with passwords. The password will be ignored and will return an error if any password information is passed in the pSecParams parameter.

Support for Microsoft® Visual Basic® for Application (VBA) 7.1

Starting with AutoCAD 2014, VBA 6.5 was replaced by VBA 7.1 which was designed for both Windows 32 and 64-bit operating systems. As a result of this change, the AutoCAD ActiveX library was updated to remove methods and properties that were originally defined to support Windows 64-bit. VBA projects that rely on the use of 32-bit libraries and controls will need to be updated to properly run on AutoCAD 64-bit.

Changes to the Adesk::Boolean, Int32 and UInt32 Types in Native C++ ARX, and Possible DWG File Compatibility Issues

This applies to developers using native C++ ARX and the Adesk namespace. Until now, in Windows, the Adesk::Boolean type has been defined (typedef-ed) as int. This was for historical reasons, as the earlier compilers did not support a native bool type. The Adesk::Int32 and UInt32 types have been defined as long and unsigned long, respectively. On the Mac platform, however, Adesk::Boolean has always been defined as bool, and Adesk::Int32 and UInt32 have always been defined as int and unsigned int.

As of this release, however, the Windows types match the Mac types, so that Boolean is always defined as bool and Int32/UInt32 are always integer/unsigned integer. See the definitions in adesk.h. This provides consistency across platforms and better type checking.

Code which uses only the Adesk types should not be affected. But, code which uses a mix of Adesk types and other types (such as native int and bool, or Win32’s BOOL) may encounter some compiler warnings or errors. For instance, you might have a function which takes an (int &) or (int *) argument, and you were passing an Adesk::Boolean variable to it. This will now cause a compiler error, because the variable’s type was previously int and now is bool. The fix would be to change either the variable type or the function’s arg type, depending on which makes more sense in your code.

A more subtle problem involves the AcDbDwgFiler::writeItem() and readItem() methods (see dbfiler.h). These are “helper” overloads which forward the call to lower level methods such as writeInt32, readBool, etc. Again, if your code is only using Adesk types, then things should work as before. But if you have variables declared as type int or BOOL, and you are calling writeItem and readItem on them, then this may cause a file compatibility error. Previously, such calls resolved to writeBoolean and readBoolean, but now they will resolve to writeInt32 and readInt32. This will cause a difference in the binary data format being read and written by your readItem and writeItem calls. Note that there might not be any compiler warning or error message in this case.

The way to detect such problems is to verify that your rebuilt code still correctly reads drawing files which were created by previous versions of your code, and conversely, that previous versions of your code correctly read drawing files that are created by your new code. If the problem occurs, then you may get warnings from AutoCAD while the drawing is being opened that says the objects were improperly read. This testing should always be done when porting to a new SDK version, but it’s especially important now.

The recommended fix for these problems is to change the variable from int or BOOL to type bool, or to type Adesk::Boolean. It is also a good idea to call the lower level readInt32, writeBoolean etc methods directly rather than the readItem and writeItem overloads, just to make it clearer what types your code is working with.