Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    96
    Provided Answers: 4

    Question Answered: DB on 32bit and 64bit Office

    Hi all

    Is there a simple way to have a DB run in both Office 32bit and 64bit environments.

    Currently we run on Office 32bit without issue, however on Office 64bit systems we get this error

    The code in this project must be updated for use on 64-bit systems.
    Please review and update Declare statements and then mark them with the PtrSafe attribute.


    Surely I don't need to re-code my DB .

    Or do I need to make a change to the LaunchApp Module in the DB, which seems to be the cause of the problem.

    Code:
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Any input would be greatly appreciated.

  2. Best Answer
    Posted by ranman256

    "set all API functions with PTRSAFE

    Code:
    #if Win64 then
       Declare PtrSafe Function MyMathFunc Lib "User32" (ByVal N As LongLong) As Long
    #else
       Declare Function MyMathFunc Lib "User32" (ByVal N As Long) As Long
    #end if
    "


  3. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    603
    Provided Answers: 31
    set all API functions with PTRSAFE

    Code:
    #if Win64 then
       Declare PtrSafe Function MyMathFunc Lib "User32" (ByVal N As LongLong) As Long
    #else
       Declare Function MyMathFunc Lib "User32" (ByVal N As Long) As Long
    #end if

  4. #3
    Join Date
    Sep 2010
    Posts
    96
    Provided Answers: 4
    Hello ranman256

    Thanks for the reply. This is perfect and a lot more simple than some of the other solutions I had seen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •