VBA-tools / VBA-Dictionary

Drop-in replacement for Scripting.Dictionary on Mac
MIT License
358 stars 89 forks source link

Specs.xlsm fails to compile on 64bit Excel #18

Open jrwagz opened 7 years ago

jrwagz commented 7 years ago

I was running the Specs.xlsm sheet in Excel 2010 64bit (14.0.7015.1000) on Windows 7 and ran into the warning about the Declare Functions needing the PtrSafe attribute.

Here is the change for the PreciseTimer class that fixes this issue:

Option Explicit

#If Mac Then
Private pStartTime As Single
#Else
#If VBA7 Then
Private Declare PtrSafe Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long
Private Declare PtrSafe Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Long
#Else
Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Long
#End If
timhall commented 6 years ago

Thanks, I'll make these fixes.