[Aide] Newbie, erreur programme

Résolu
Calcium88 Messages postés 2 Date d'inscription dimanche 7 août 2005 Statut Membre Dernière intervention 8 août 2005 - 8 août 2005 à 11:15
Calcium88 Messages postés 2 Date d'inscription dimanche 7 août 2005 Statut Membre Dernière intervention 8 août 2005 - 8 août 2005 à 13:34
Salut,



Bon voila je suis un noob en programmation seulement ces dernier temps
j'ai besoin d'éffectuer une action répétitive. J'ai donc pris la
décision de créer un programme en C++ qui simulerait mes clics durant
mon abcense (jusque la rien de trop compliqué). Cependant en m'aidant
du logiciel "Dev-C++" et en incorporant le programme donné par Jeromax
dans ce tuto (http://www.vbfrance.com/code.aspx?ID=701#commentaires)
j'arrive a obtenir une erreur (j'ai a peine commencé que j'ai une
erreur, the noob). Voila ce que ca donne :



#include <cstdlib>

#include



using namespace std;



int main(int argc, char *argv[])

{

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Private Declare Function SetCursorPos& Lib "user32" (ByVal X As Long, ByVal Y As Long)



Const MOUSEEVENTF_ABSOLUTE = &H8000

Const MOUSEEVENTF_LEFTDOWN = &H2

Const MOUSEEVENTF_LEFTUP = &H4

Const MOUSEEVENTF_MIDDLEDOWN = &H20

Const MOUSEEVENTF_MIDDLEUP = &H40

Const MOUSEEVENTF_MOVE = &H1

Const MOUSEEVENTF_RIGHTDOWN = &H8

Const MOUSEEVENTF_RIGHTUP = &H10

Const MOUSEEVENTF_WHEEL = &H80

Const MOUSEEVENTF_XDOWN = &H100

Const MOUSEEVENTF_XUP = &H200

Const WHEEL_DELTA = 120

Const XBUTTON1 = &H1

Const XBUTTON2 = &H2





Private Sub Command1_Click()

X = 30

Y = 755

SetCursorPos X, Y



Call mouse_event(MOUSEEVENTF_LEFTDOWN + MOUSEEVENTF_ABSOLUTE, Me.Left, Me.Top, 0, 0)

Call mouse_event(MOUSEEVENTF_LEFTUP + MOUSEEVENTF_ABSOLUTE, Me.Left, Me.Top, 0, 0)

End Sub

}





Et les erreurs sont les suivantes :

1) `Private' undeclared (first use this function)

(Each undeclared identifier is reported only once for each function it appears in.)

2) expected `;' before "Declare"



Soyez indulgent je suis un noob seulement ce programme me simplifierait la vie....



Merci à vous

(emmanuelballery@msn.com)

3 réponses

Tilois Messages postés 721 Date d'inscription dimanche 10 juin 2001 Statut Membre Dernière intervention 27 mars 2011 7
8 août 2005 à 11:24
La tu as fait un mix entre du VB et du C ....
3
Gobillot Messages postés 3140 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 11 mars 2019 34
8 août 2005 à 11:25
je crois que tu mélanges les deux langages C++ et Visual basic

Daniel
3
Calcium88 Messages postés 2 Date d'inscription dimanche 7 août 2005 Statut Membre Dernière intervention 8 août 2005
8 août 2005 à 13:34
Et existe-t-il une version du programme de "clic" en C++ ?
0
Rejoignez-nous