Consulting

Results 1 to 11 of 11

Thread: Get a Structure from a Pointer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Get a Structure from a Pointer

    Hi,

    I am using WinAPI calls with VBA. How do I access a RECT from the pointer to it that the API returns? Something like this:

    [vba]
    Private Type RECT
    left As Long
    top As Long
    right As Long
    bottom As Long
    End Type

    Private Function CBTProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

    If nCode = HCBT_MOVESIZE Then
    Dim WinRect As RECT
    WinRect = lParam ' But lParam is only a pointer to the RECT!
    Debug.Print WinRect.left
    end If

    End Function
    [/vba]

    Thanks
    Last edited by Adamski; 06-08-2010 at 08:26 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
  •