OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 20-04-2014, 17:30
HeauxmBru HeauxmBru is offline
Junior Member
Join Date: Jan 2011
Posts: 17
Default using 32-bit macros in 64-bit X6 or X7

Ive searched to see if anyone was having trouble using their 32-bit macros in X6 or X7 64-bit. I didn't find much. I was however having trouble with my old macros and have been searching for a solution.

I found a solution in the Help file in the Macro Editor under the 64-Bit Visual Basic for Applications Overview which basically says that the Declare statements for win32 API calls must be modified as follows:

Public Declare PtrSafe Function GetCursorPos Lib "user32" (ByRef pos As lpPoint) As Boolean

Private Declare PtrSafe Function CreateEvent Lib "kernel32" Alias "CreateEventA" _
        (ByVal lpEventAttributes As LongPtr, ByVal bManualReset As LongPtr, _
        ByVal bInitialState As LongPtr, ByVal lpName As String) As LongPtr
I tried it in both X6 and X7 64-bit and my old macros now work in 64-bit. Notice the PtrSafe keyword which declares the statement can be used in 64-bit environments and the LongPtr data type alias which keeps the macro backward compatible while usable in 64-bit.

Just thought I would share just in case anyone was have trouble.
Reply With Quote
Old 22-04-2014, 22:22
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,941
Blog Entries: 4

Thanks, that's a good info to share. Also, to get 64-bit compatible declarations of Win32 functions, I use this: http://www.microsoft.com/en-us/downl...s.aspx?id=9970

When installed it, puts a text file with all the Win32 declarations into C:\Office 2010 Developer Resources\Documents\Office2010Win32API_PtrSafe\Win32API_PtrSafe.txt

Very handy
Reply With Quote
Old 24-04-2014, 05:29
HeauxmBru HeauxmBru is offline
Junior Member
Join Date: Jan 2011
Posts: 17

Very cool file. Thanks for the link!
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabled macros? djenous Macros/Add-ons 4 12-07-2012 12:01
CurveEffects macros for x5 gorgo Macros/Add-ons 0 14-08-2010 23:21
X3 macros used in X4 CWCN CorelDRAW/Corel DESIGNER VBA 1 04-11-2009 13:25
my macros for corel Feidias CorelDRAW/Corel DESIGNER VBA 0 08-08-2008 07:44
2 Macros 1 Button vindaa CorelDRAW/Corel DESIGNER VBA 4 11-04-2008 21:24

All times are GMT -5. The time now is 12:21.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com