Results 1 to 2 of 2

Thread: DrawAnimatedRects

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Question

    Has anyone got this working in VB? This is what I have:

    *** HEADER FILE ***

    Public Type SMALL_RECT
    Left As Integer
    Top As Integer
    Right As Integer
    Bottom As Integer
    End Type

    Declare Function DrawAnimatedRects Lib "user32" (ByVal hwnd As Long, ByVal idAni As Integer, ByRef lprcFrom As SMALL_RECT, ByRef lprcTo As SMALL_RECT)

    *** CALLING FUNCTION ****

    Private mox, moy As Single ' in declarations

    Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Dim area_rect As SMALL_RECT
    Dim full_rect As SMALL_RECT

    full_rect.Left = 0
    full_rect.Top = 0
    full_rect.Right = Picture1.Width
    full_rect.Bottom = Picture1.Height

    area_rect.Left = mox ' set by mouse_down (local)
    area_rect.Right = X
    area_rect.Top = moy ' set by mouse_down (local)
    area_rect.Bottom = Y

    DrawAnimatedRects Picture1.hwnd, 0, area_rect, full_rect

    End Sub


    When I run the program I get "Run time error 49, Bad Dll calling convention"

    Do you know where I am going wrong?

    Cheers


  2. #2
    Addicted Member Bregalad's Avatar
    Join Date
    Jul 2000
    Location
    Oslo,Norway
    Posts
    183

    RECT type

    I'm having some trouble with it too, but I don't get an error. Just nothing happening.

    Your problem could be the definition of SMALL_RECT, where
    the variables you're using are of type Integer, while the
    API-Viewer's declaration of RECT is like this:

    Public Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
    End Type




Posting Permissions

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



Click Here to Expand Forum to Full Width