[AccessD] Issues with running applications in 64 bit version of Office

Stuart McLachlan stuart at lexacorp.com.pg
Mon Jan 30 07:33:43 CST 2012


I've only built one application which  has to run under Win7/Office 10 64bit.

The only changes I had to make to the A2003 code was to conditionally declare API calls 
along the lines of:

#If VBA7 Then
Declare PtrSafe Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, 
ByVal dwMilliseconds As Long) As Long
Declare PtrSafe Function CreateProcessA Lib "kernel32" (ByVal lpApplicationName As Long, 
ByVal lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal 
lpThreadAttributes As Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As 
Long, ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As 
STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Declare PtrSafe Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
#Else
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal 
dwMilliseconds As Long) As Long
Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplicationName As Long, ByVal 
lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As 
Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment 
As Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, 
lpProcessInformation As PROCESS_INFORMATION) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
#End If

Once I did that, the same MDB runs under anything from A2003, A2007 and A2010 32 bit 
and 64bit.

You only need to change API calls from LONG to LONGPTR if you are calling 64bit DLLs.

-- 
Stuart

On 30 Jan 2012 at 8:20, Mark Simms wrote:

> I've never seen VBA7 and WIN64 directives used together.
> So if VBA7 is true, do the API calls need to have Longs replaced by LongPtr
> for example ?
> Or only if WIN64 is true.
> I'm still confused....are there 4 combination of conditions to handle here ?
> Or only 2 ? or 3 ?
> VBA7 must be explicitly set to False in Excel 2003 ?
> #Const VBA7=False
> 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list