PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Problem mit Threads


Bolle
12.05.2002, 12:19
so, hab mal eine frage zu threads.
hier erst mal der quellcode, vielleicht seht ihr ja auf anhieb fehler.


typedef struct{bool bKill;}KPARAM, *PKPARAM;
static KPARAM Param;
DWORD dwThreadID[1];
void sockets(PVOID Param);
...
void sockets(PVOID Param)
{
PKPARAM pparams = (PKPARAM) Param;
while(!pparams->bKill)
{...}
}
...
CreateThread( NULL,0, sockets, &Param ,0 ,&dwThreadID[0] );


so, wenn ich das nun versuche mit vc++ 6 zu kompilieren, bekomme ich folgende fehlermeldung.

error C2664: ´CreateThread´ : cannot convert parameter 3 from ´void (void *)´ to ´unsigned long (__stdcall *)(void *)´
None of the functions with this name in scope match the target type

kann mir einer sagen was das zu bedeuten hat?
hab auch schon in die msnd geguck, hat aber nicht wirklich was herorgebracht.


xOOn
12.05.2002, 16:44
die routine muss fulgende form haben

DWORD WINAPI ThreadProc(
LPVOID lpParameter // thread data
);

->>
DWORD WINAPI sockets(PVOID Param);