Conversion to 64-bit

I've never seen the API in post #1 before and have no idea of its purpose.
However CoPilot indicates the 64-bit compatible version is:

Code:
Public Declare PtrSafe Function ezGetFileInfo Lib "msaccess.exe" Alias "#56# (FSI As ezGetFileInfo, ByVal fOpen As Integer) As LongPtr

You'll need to test to see if that works.
I wonder whether using FSO would achieve the same outcomes.

@arnelgp wrote:
you only need to add PtrSafe if there is no Window handle on the function/sub:
I've no idea what he meant but you need PtrSafe on ALL APIs used in 64-bit Access together with conversion of handles/pointers to LongPtr
Remember that adding PtrSafe will allow the code to compile but that doesn't necessarily mean it will work
 
Last edited:
I've no idea what he meant but you need
from the Context of the function the OP posted, the Information will be stored to FSI, so it will only Return a Long (status of the operation) and not a window handler. That is the reason i proposed to add only PtrSafe.

Yet we don't know the structure of ezGetFileInfo if it already VBA7-compatible.
 
Ah I had misunderstood what you wrote. In that case we agree completely on the principle involved, though CoPilot ‘thinks’ otherwise
 
Public Declare Function ezGetFileInfo Lib "msaccess.exe" Alias "#56# (FSI As ezGetFileInfo, ByVal fOpen As Integer) As Long

The function does not exist in Win32API_PtrSafe.txt.

Any ideas?
Unless I'm mistaken, the export #56 from msaccess.exe is just a file dialog to select a file.
There are documented and supported solutions available for that purpose. Thus, I would recommend replacing this old, never officially supported API declaration with a supported alternative, e.g., Application.FileDialog.
 
I've never seen the API in post #1 before and have no idea of its purpose.
However CoPilot indicates the 64-bit compatible version is:

Code:
Public Declare Function ezGetFileInfo Lib "msaccess.exe" Alias "#56# (FSI As ezGetFileInfo, ByVal fOpen As Integer) As LongPtr

You'll need to test to see if that works.
I wonder whether using FSO would achieve the same outcomes.

@arnelgp wrote:

I've no idea what he meant but you need PtrSafe on ALL APIs used in 64-bit Access together with conversion of handles/pointers to LongPtr
Remember that adding PtrSafe will allow the code to compile but that doesn't necessarily mean it will work
Hi Colin

High marks for effort to CoPilot. Compare to the one I came up with. The first one is CoPilot's

Public Declare Function ezGetFileInfo Lib "msaccess.exe" Alias "#56# (FSI As ezGetFileInfo, ByVal fOpen As Integer) As LongPtr
Public Declare PtrSafe Function ezGetFileInfo Lib "msaccess.exe" Alias "#56" (FSI As ezFileSelInfo, ByVal fOpen As Integer) As Long

See the differences in Red
 
Actually my mistake re CoPilot. I copied and pasted the 32-bit variant by mistake, changed to LongPtr as it suggested but forgot the PtrSafe!
Looks like CoPilot lost a quote mark however!
FWIW I've edited post #21 even though it appears CoPilot was wrong about the LongPtr

However, as both Philipp and I have suggested, you'd be better off scrapping that API. Its archaic and other methods now exist to do the same thing
 

Users who are viewing this thread

Back
Top Bottom