UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> 64-bit V 32-bit, Any Version    
 
   
azizrasul
post Oct 29 2019, 09:13 AM
Post#1



Posts: 1,514
Joined: 18-July 00
From: Faisalabad, Pakistan


I have a MS Access 2010 db which is used on a Windows 10 machine as well as a Windows 7 machine. On the Windows 10 machine I have

CODE
#If VBA7 Then
    Public Declare PtrSafe Function MicGetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
    Public Declare PtrSafe Function MicGetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
    Public Declare PtrSafe Function MicCommDlgExtendedError Lib "comdlg32.dll" () As Long
#Else
    Public Declare Function MicGetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
    Public Declare Function MicGetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
    Public Declare Function MicCommDlgExtendedError Lib "comdlg32.dll" () As Long
#End If

The lines

CODE
    Public Declare Function MicGetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
    Public Declare Function MicGetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
    Public Declare Function MicCommDlgExtendedError Lib "comdlg32.dll" () As Long

remain in red. What am I doing wrong?

--------------------
Aziz
Go to the top of the page
 
cheekybuddha
post Oct 29 2019, 09:17 AM
Post#2


UtterAccess VIP
Posts: 11,676
Joined: 6-December 03
From: Telegraph Hill


This is OK.

One section will always be red depending on whether the machine you are using is running 32/64bit Access.

--------------------


Regards,

David Marten
Go to the top of the page
 
azizrasul
post Oct 29 2019, 09:21 AM
Post#3



Posts: 1,514
Joined: 18-July 00
From: Faisalabad, Pakistan


That was quick Dave. Ok I understand.

--------------------
Aziz
Go to the top of the page
 
isladogs
post Oct 29 2019, 09:41 AM
Post#4


UtterAccess VIP
Posts: 1,793
Joined: 4-June 18
From: Somerset, UK


QUOTE
One section will always be red depending on whether the machine you are using is running 32/64bit Access.


Actually not quite true:
Using 64-bit, the #Else section does appear in red
If you have A2007 or earlier, the #VBA7 section appears in red (as you are using VBA6)
However using 32-bit A2010 or later (#VBA7), both sections appear in blue/black as both are valid (but #VBA7 will apply)

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
BruceM
post Oct 29 2019, 09:55 AM
Post#5


UtterAccess VIP
Posts: 7,985
Joined: 24-May 10
From: Downeast Maine


The VBA7 conditional compilation is necessary if any computers where the database is deployed have Office 2007 or earlier, with a caveat: In all or most cases the older version will work in a 32-bit Office environment, but will fail in a 64-bit environment if the code includes pointers to memory locations. Variables such as hWnd are typically in that category, where "As LongPtr" is used instead of "As Long". VBA7 allocates 32 bits of memory for such a pointer or handle in a 32-bit environment, and 64 bits in a 64-bit environment. That is a sort of flyover, and may not be a precise explanation, but it's the general idea.
Go to the top of the page
 
cheekybuddha
post Oct 29 2019, 10:21 AM
Post#6


UtterAccess VIP
Posts: 11,676
Joined: 6-December 03
From: Telegraph Hill


Thanks, Colin, for the clarification. thumbup.gif

d

--------------------


Regards,

David Marten
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th November 2019 - 06:53 AM