erreur à la création de thread
coucou à tous, j’ai une erreur lors de ma création de la thread, j’ai consulté la faq mais pas possibilité de voir ou je me suis trompé.
Voyer vous ou je me suis planter ?
voici mes déclaration dans la class:
Code:
1 2 3 4 5 6 7
|
...
HANDLE m_watchEvent;
DWORD m_threadID;
...
static DWORD WINAPI CommWatchProc(LPVOID pParam);
... |
la structure suivante est global et contient des informations sur mon application pourvant être modifier lors du thread:
Code:
1 2 3 4 5 6 7 8 9 10 11
|
typedef struct structthreadinfo
{
HANDLE *m_hCom;
DWORD *m_threadID;
HANDLE *m_watchThread;
OVERLAPPED *m_ovRead;
bool *testencour;
}threadinfo;
threadinfo info; |
voici de début de ma fonctionCommWatchProc:
Code:
1 2 3 4 5
|
DWORD WINAPI CCom::CommWatchProc(LPVOID pParam)
{
structthreadinfo *threadinfo = reinterpret_cast< structthreadinfo *>( pParam);
... |
et pour finir la création de mon thread:
Code:
1 2 3 4 5 6 7 8 9 10
|
DWORD dwCreationFlags=0;
DWORD dwStackSize=0;
...
com.m_watchThread = CreateThread((LPSECURITY_ATTRIBUTES )NULL,
(DWORD)dwStackSize,
(LPTHREAD_START_ROUTINE)CommWatchProc,
(LPVOID)&info,
(DWORD)dwCreationFlags,
(LPDWORD)&com.m_threadID); |
voici l'érreur signalé
Citation:
error C2440: 'type cast' : cannot convert from '' to 'unsigned long (__stdcall *)(void *)'
je vous remercie d'avance