I have been trying to prepare a db for use in the 2013 32 / 64 bit versions of access runtime. (preferentially 64bit).
One of my forms causes the application to shut down. I have error trapping on all procedures, and some initial fiddling with the Declare statements has improved but not fixed the problem.
I am working on the following premise - the fact that I can't trap the error means the problem lies within the Declaration section of the VBA. (The fact that some fiddling has already improved the situation also tells me that I'm on the right path.)
My research on 64 bit declare statement has me confused. Micrsoft has said that you need to use LongPtr and LongLong, but yet their list of examples contaradicts this: eg
Published by Microsoft. Note the As Long at the end!
So here is my code - any help / corrections would be appreciated.
Also, why would this issue not be arising on my 64bit installation - even when using the runtime emulation mode?
One of my forms causes the application to shut down. I have error trapping on all procedures, and some initial fiddling with the Declare statements has improved but not fixed the problem.
I am working on the following premise - the fact that I can't trap the error means the problem lies within the Declaration section of the VBA. (The fact that some fiddling has already improved the situation also tells me that I'm on the right path.)
My research on 64 bit declare statement has me confused. Micrsoft has said that you need to use LongPtr and LongLong, but yet their list of examples contaradicts this: eg
Code:
Declare PtrSafe Function WaitForSingleObjectEx Lib "kernel32" Alias "WaitForSingleObjectEx" (ByVal hHandle As LongPtr, ByVal dwMilliseconds As Long, ByVal bAlertable As Long) As Long
So here is my code - any help / corrections would be appreciated.
Also, why would this issue not be arising on my 64bit installation - even when using the runtime emulation mode?
Code:
#If VBA7 Then
#If Win64 Then
Private Declare PtrSafe Function WaitForSingleObject Lib "kernel32" _
Alias "WaitForSingleObjectEx" (ByVal hHandle As LongPtr, _
ByVal dwMilliseconds As Long) As Long
Private Declare PtrSafe Function CloseHandle Lib "kernel32" ( _
ByVal hObject As LongPtr) As LongPtr
Private Declare PtrSafe Function OpenProcess Lib "kernel32" _
(ByVal dwAccess As Long, _
ByVal fInherit As Long, _
ByVal hObject As Long) As LongPtr
#Else
Private Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal _
hObject As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" _
(ByVal dwAccess As Long, _
ByVal fInherit As Integer, _
ByVal hObject _
As Long) As Long
#End If
#Else
#End If