Author Topic: VBA 7.1 migration - API issues  (Read 5528 times)

0 Members and 1 Guest are viewing this topic.

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
VBA 7.1 migration - API issues
« on: April 09, 2013, 02:55:26 PM »
With AutoCAD 2014 we have (finally) 64 bit VBA. (version 7.1)
Along with this comes some issues and updating of code.

Any API calls need to be addressed.
This is one article that explains some of the issues. http://msdn.microsoft.com/en-us/library/office/ee691831(v=office.14).aspx/
Quote
In VBA 7, you must update existing Windows Application Programming Interface (API) statements (Declare statements) to work with the 64-bit version. Additionally, you must update address pointers and display window handles in user-defined types that are used by these statements.

VBA 7 is a new code base, replacing the earlier version of VBA. VBA 7 exists for both the 32-bit and 64-bit versions of Office 2010. It provides two conditional compilation constants: VBA7 and Win64. The VBA7 constant helps ensure the backward compatibility of your code by testing whether your application is using VBA 7 or the previous version of VBA. The Win64 constant is used to test whether code is running as 32-bit or as 64-bit. Both of these compilation constants are demonstrated later in this article.

So there is a new attribute:
PtrSafe

New conditional compilation constants:
VBA7
WIN64

New data types:
LongPtr
LongLong

I found this link very helpful and thought I would share.
http://www.jkp-ads.com/articles/apideclarations.asp
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions