connecting users of the CorelDRAW family of products

SOT Macro Problems

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 2 Replies | 2 Followers

Share  
Page 1 of 1 (3 items) | RSS

Greatly Perturbed posted on Sat, Mar 24 2012 22:33

Lots of my macros for X5 seem to be broken with X6. How can I browse for a folder? Also what does this mean and how do I mark declare statements with a PtrSafe attribute?

---------------------------
Microsoft Visual Basic for Applications
---------------------------
Compile error:

The code in this project must be updated for use on 64-bit systems.  Please review and update Declare statements and then mark them with the PtrSafe attribute.
---------------------------
OK   Help  
---------------------------

All Replies

I just found this Microsoft page that explains how to update - add the word PtrSafe immediately after the declaration. Eg  Declare Function [name] becomes Declare PtrSafe Function [name].

Top 200 Contributor
Cheyenne, WY
Male

Most Macros will work just fine in X6 (64-Bit) however as you have seen those macros that use WinAPI calls need to be updated. Here is another page that is really helpful as they provide example to some of the more common calls:

Declaring API Functions In 64 Bit

Microsoft also provides common definitions for VBA7 that are very helpful and saves some typing, just copy and paste what you need:

Win32API_PtrSafe with 64-bit Support

-Shelby

  • Filed under:
Page 1 of 1 (3 items) | RSS
© Corel Corporation. The content herein is in the form of a personal web log ("Blog") or forum posting. As such, the views expressed in this site are those of the participants and do not necessarily reflect the views of Corel Corporation, or its affiliates and their respective officers, directors, employees and agents. Terms and Conditions / User Guidelines.