Partage
  • Partager sur Facebook
  • Partager sur Twitter

winmm.dll

    8 octobre 2011 à 1:35:17

    Bonjour à tous

    Je suis novice en VB.net j'essaye de faire tourner ce code mais il démarre et puis rien. J'essaye pas à pas mais il n'arrive même pas au loaod
    Quelqu'un aurait-il une idée?
    Module Module1
        Declare Function joyGetPosEx Lib "winmm.dll" (ByVal uJoyID As Long, ByVal pji As Type_JoyInfoEx) As Integer
    
        Public Const JOY_RETURN_ALL = &HFFF
    
        Structure Type_JoyInfoEx
            Dim dwSize As Integer              '  taille de la structure
            Dim dwFlags As Integer               '  flags to indicate what to return
            Dim dwXpos As Integer               '  x position
            Dim dwYpos As Integer               '  y position
            Dim dwZpos As Integer               '  z position
            Dim dwRpos As Integer               '  rudder/4th axis position
            Dim dwUpos As Integer                '  5th axis position
            Dim dwVpos As Integer                '  6th axis position
            Dim dwButtons As Integer             '  etats des bouttons
            Dim dwButtonNumber As Integer       '  numero du bouton presse actuellement
            Dim dwPOV As Integer                 '  point of view state
            Dim dwReserved1 As Integer               '  reserved for communication between winmm driver
            Dim dwReserved2 As Integer              '  reserved for future expansion
        End Structure
    
        Public Manette As Type_JoyInfoEx
    
    End Module
    
    
    Public Class Form1
    
        Private Sub Form_Load()
    
    
            Timer1.Interval = 10
            Timer1.Enabled = True
        End Sub
    
        Private Sub Timer1_Timer()
    
    
            Manette.dwSize = 64
            Manette.dwFlags = JOY_RETURN_ALL
    
            joyGetPosEx(0, Manette) ' Envoi toutes les informations du contrôleur n°0 dans "Manette"
            'Call joyGetPosEx(1, Manette) ' Envoi toutes les informations du contrôleur n°1 dans "Manette"
            'Call joyGetPosEx(2, Manette) ' Envoi toutes les informations du contrôleur n°2 dans "Manette"
    
            Label1.Text = _
                    "Xpos =" + Str$(Manette.dwXpos) + vbLf _
                  + "Ypos =" + Str$(Manette.dwYpos) + vbLf _
                  + "Zpos =" + Str$(Manette.dwZpos) + vbLf _
                  + "Rpos =" + Str$(Manette.dwRpos) + vbLf _
                  + "Upos =" + Str$(Manette.dwUpos) + vbLf _
                  + "Vpos =" + Str$(Manette.dwVpos) + vbLf _
                  + "'Point de vue' =" + Str$(Manette.dwPOV) + vbLf _
                  + "qté boutons appuyés =" + Str$(Manette.dwButtonNumber) + vbLf _
                  + "état boutons =" + Str$(Manette.dwButtons)
    
        End Sub
    
    
    
    End Class
    
    • Partager sur Facebook
    • Partager sur Twitter

    winmm.dll

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown