Announcement

Collapse
No announcement yet.

I Should Probably Already Know This

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I Should Probably Already Know This

    In WIN32API.INC what does the "AS ANY" in RegisterRawInputDevices mean? I've tried
    all kinds of things in that position (the array name, pointer to the array, etc.) but I keep getting "Parameter mismatches definition."

    DECLARE FUNCTION RegisterRawInputDevices LIB "USER32.DLL" ALIAS "RegisterRawInputDevices" (pRawInputDevices AS ANY, BYVAL uiNumDevices AS DWORD, BYVAL cbSize AS DWORD) AS LONG

    My code is:
    Code:
    GLOBAL xx AS RAWINPUTDEVICE
    '  :
    '  :
    DIM xx(1 TO 1) AS GLOBAL RAWINPUTDEVICE
    '  :
    '  :
        CASE %WM_INITDIALOG           ' Initialization handler
          xx(1).usUsagePage=5 ' standard gamepad
          xx(1).usUsage=1
          xx(1).dwFlags=0
          xx(1).hwndTarget=%NULL
          szoxx???=SIZEOF(xx(1))
    
          IF RegisterRawInputDevices <what goes here?>, 1, szoxx??? THEN ' ...
    TIA, (PowerBASIC is great; I use it every day to automate all kinds of things.)
    Steve

  • #2
    IF RegisterRawInputDevices <what goes here?>, 1, szoxx??? THEN ' ...
    It goes a pointer to the first element of the array.

    Code:
    IF RegisterRawInputDevices xx(1), 1, szoxx??? THEN ' ...
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      Thx, tried that, it doesn't work. (mismatch message)

      BTW, thanks very much José for all your excellent postings in this forum and your own.
      Steve

      Comment


      • #4
        The issue is unresolved at every VB site I found, too.

        So maybe there is some problem in the heart of the operating system.
        Steve

        Comment


        • #5
          Works Fine Now; I was missing some parentheses

          IF RegisterRawInputDevices(xx(1),1,szoxx???) THEN...
          Steve

          Comment


          • #6
            > but I keep getting "Parameter mismatches definition."

            You should only get that if you try to use a literal or expression, as 'AS ANY' means "address of the variable passed in this position" and literals and expressions are not variables.

            Any other variable is, well, a variable.
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment

            Working...
            X