OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 20-04-2014, 16: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:

Code:
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
  #2  
Old 22-04-2014, 21:22
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

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
  #3  
Old 24-04-2014, 04:29
HeauxmBru HeauxmBru is offline
Junior Member
 
Join Date: Jan 2011
Posts: 17
Default

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


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 11:01
CurveEffects macros for x5 gorgo Macros/Add-ons 0 14-08-2010 22:21
X3 macros used in X4 CWCN CorelDRAW/Corel DESIGNER VBA 1 04-11-2009 12:25
my macros for corel Feidias CorelDRAW/Corel DESIGNER VBA 0 08-08-2008 06:44
2 Macros 1 Button vindaa CorelDRAW/Corel DESIGNER VBA 4 11-04-2008 20:24


All times are GMT -5. The time now is 15:42.


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