cs_lamalice83
Messages postés93Date d'inscriptionmardi 3 juin 2003StatutMembreDernière intervention26 septembre 2006
-
27 juin 2004 à 14:16
BruNews
Messages postés21041Date d'inscriptionjeudi 23 janvier 2003StatutModérateurDernière intervention21 août 2019
-
27 juin 2004 à 14:34
bonjour,
j'essaye de créer un thread à l'intérieur d'une classe, mais je n'arrive pas à l'associer avec sa fonction de routine:
Dans le CLASSCtl.h :
afx_msg UINT WINAPI _R(void);
Dans le CLASSCtl.cpp:
void CLASSCtrl::FonctionX()
{
unsigned long lptL;
// une création de thread possible
//hndThread = AfxBeginThread(_R,THREAD_PRIORITY_NORMAL,0,0,NULL);
// une autre création de thread possible
hndThread = CreateThread(NULL,0,_R,NULL,0,&lptL);
}
UINT WINAPI CLASSCtrl::_R(void)
{
//routine d'exécution....
return 0;
}
J'ai cette erreur qui s'affiche: error C2664: 'CreateThread' :
cannot convert parameter 3 from 'unsigned int (void)' to 'unsigned long (__stdcall *)(void *)'
Même en déclarant la fonction en static ça na marche pas.