Rob4077
asked on
Declare Function DeleteUrlCacheEntry 64 bit system
I am using the following function in one of my databases that needs to run on both 32 bit and 64 bit systems. Two questions:
1) Is there any way to modify it so it will run on both, or do I need different front ends for each version?
2) What do I need to do to make it run on a 64 bit version of MS Access (2010)?
Private Declare Function DeleteUrlCacheEntry Lib "wininet" Alias _
"DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
1) Is there any way to modify it so it will run on both, or do I need different front ends for each version?
2) What do I need to do to make it run on a 64 bit version of MS Access (2010)?
Private Declare Function DeleteUrlCacheEntry Lib "wininet" Alias _
"DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your URLDownloadToFile function will return a LongPtr value in Access 2010. So you may need additional code changes such as
#if VBA7 then
dim ReturnVal as LongPtr
#Else
dim ReturnVal as Long
#end if
ReturnVal = URLDownloadToFile(...
#if VBA7 then
dim ReturnVal as LongPtr
#Else
dim ReturnVal as Long
#end if
ReturnVal = URLDownloadToFile(...
ASKER
Can I just change it to Single instead of LongPtr/Long ?
No.
ASKER
All works perfectly. Thanks.
ASKER