Share via

CONVERT DECLARATION FOR 64 BIT

Anonymous
2012-10-19T09:16:59+00:00

Good Morning

Can anyone help, please??  I need to adjust the following delare statement (Created in Access 2007 32 bit) for use on Access 2010 64bit (no they won't change to 32 bit - I've tried that!).  Can anyone give me the new code I need, or explain what I need to do?  Please...

Declare Function SHGetPathFromIDListA Lib "shell32.dll" ( _

    ByVal pidl As Long, _

    ByVal pszBuffer As String) As Long

Declare Function SHBrowseForFolderA Lib "shell32.dll" ( _

    lpBrowseInfo As BrowseInfo) As Long

Many thanks

Geoff

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2012-10-19T11:20:58+00:00

Try

Declare PtrSafe Function SHGetPathFromIDListA Lib "shell32.dll" ( _

     ByVal pidl As LongPtr, ByVal pszPath As String) As Boolean

Declare PtrSafe Function SHBrowseForFolderA Lib "shell32.dll" ( _

    lpBrowseInfo As BROWSEINFO) As LongPtr

You also need to change the declaration of the BrowseInfo type:

Type BROWSEINFO

    hOwner As LongPtr

    pidlRoot As Long

    pszDisplayName As String

    lpszTitle As String

    ulFlags As Long

    lpfn As LongPtr

    lParam As LongPtr

    iImage As Long

End Type

See http://www.jkp-ads.com/articles/apideclarations.asp

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2012-10-19T11:22:42+00:00

    Try:

    Declare PtrSafe Function SHGetPathFromIDListA Lib "shell32.dll" ( _

        ByVal pidl As Long, _

        ByVal pszBuffer As String) As Long

    Declare PtrSafe Function SHBrowseForFolderA Lib "shell32.dll" ( _

        lpBrowseInfo As BrowseInfo) As Long

    See Compatibility Between the 32-bit and 64-bit Versions of Office 2010 or Declaring API functions in 64 bit Office for more information.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments