In 32-bit VBA, memory pointers and handles were stored in 32-bit integers (Long data type). In a 64-bit environment, pointers are 64-bit integers. Storing a 64-bit pointer in a 32-bit Long variable results in data truncation and overflow errors.
The Solution: AutoCAD 2015 VBA supports the LongPtr data type introduced in the VBA 7.1 update. autocad 2015 vba module 64-bit
Developers must use the PtrSafe keyword in API declarations and replace Long with LongPtr for any variable handling memory addresses or window handles. In 32-bit VBA, memory pointers and handles were
While the module enables the execution of most standard VBA macros, there are distinct limitations compared to the .NET API: Developers must use the PtrSafe keyword in API
In 64-bit AutoCAD, all API declarations must use PtrSafe and pointer types.