Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Vlad
    There are lots of errors in the API declarations. Although it compiles in 64-bit, that doesn't mean all the declarations actually work
    For example, all handles/pointers such as hWnd, hDc need to be LongPtr...
    I suspect almost all of the declarations aren't actually in use in your example file



    Anyway, in case it helps, I've gone through the declarations in frmMBox:

    Code:
    #If VBA7 Then   
     'Declarations for A2010 or later (32-bit or 64-bit)
      ....
        
        'pixels2twips declares
        Private Declare PtrSafe Function apiGetDC Lib "user32" Alias "GetDC" (ByVal hwnd As LongPtr) As LongPtr 'CR
        Private Declare PtrSafe Function apiReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As LongPtr, ByVal hDC As LongPtr) As Long 'CR
        Private Declare PtrSafe Function apiGetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps" (ByVal hDC As LongPtr, ByVal iCapability As Long) As Long 'CR
         
        .... 
        Private Declare PtrSafe Function apiMoveWindow Lib "user32" Alias "MoveWindow" (ByVal hwnd As LongPtr, _
            ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
        Private Declare PtrSafe Function apiGetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As LongPtr, lpRect As RECT) As Long
        
        Private Declare PtrSafe Function apiGetSysColor Lib "user32" Alias "GetSysColor" (ByVal nIndex As Long) As Long
        Private Const COLOR_BTNFACE = 15
        
        Private Declare PtrSafe Function apiGetTempPath Lib "kernel32" Alias "GetTempPathA" _
            (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
        
        Private Declare PtrSafe Function apiGetTextFace Lib "gdi32" Alias "GetTextFaceA" (ByVal hDC As LongPtr, _
            ByVal nCount As Long, ByVal lpFacename As String) As Long
        
        'SL's autosize declares
       ...
        
        Private Declare PtrSafe Function apiSelectObject Lib "gdi32" Alias "SelectObject" (ByVal hDC As LongPtr, _
        ByVal hObject As LongPtr) As LongPtr 'CR
        
        ...
        
        Private Declare PtrSafe Function apiCreateIC Lib "gdi32" Alias "CreateICA" _
        (ByVal lpDriverName As String, ByVal lpDeviceName As String, _
        ByVal lpOutput As String, lpInitData As Any) As LongPtr 'CR
          
        Private Declare PtrSafe Function apiDeleteDC Lib "gdi32" _
          Alias "DeleteDC" (ByVal hDC As LongPtr) As Long 'CR
          
        Private Declare PtrSafe Function apiDrawText Lib "user32" Alias "DrawTextA" _
        (ByVal hDC As LongPtr, ByVal lpStr As String, ByVal nCount As Long, _
        lpRect As RECT, ByVal wFormat As Long) As Long 'CR
        
       ...
    #Else
    ....
    See attached

    NOTE: I've not looked through the declarations in the rest of the file):

    A useful resource for 32/64-bit conversion: https://www.rondebruin.nl/win/dennis...sapiviewer.htm
    Attached Files Attached Files
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  2. #17
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Hi Colin,
    Thank you very much for this. I think you're right that most\some are not used (or used with in some odd usage instances that I have not needed). I have done the original conversion years ago to make it work in 64, the feature I use most is the countdown timer for un-attended prompts (when running scheduled tasks) and that seemed to work fine. And thank you for the link, looks like a great tool.
    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Icons are squashed
    By sifuhall in forum Forms
    Replies: 1
    Last Post: 05-22-2018, 11:39 AM
  2. Custom button captions msgbox
    By Ruegen in forum Access
    Replies: 2
    Last Post: 11-20-2013, 03:59 PM
  3. Desktop Icons
    By Neil Bingham in forum Access
    Replies: 1
    Last Post: 05-12-2011, 10:29 AM
  4. Custom MsgBox
    By roccoIT in forum Programming
    Replies: 3
    Last Post: 07-06-2010, 10:43 AM
  5. Button Icons and MSG Box Icons
    By Mclaren in forum Programming
    Replies: 6
    Last Post: 06-22-2010, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums