[Winpcap-users] Re: thread error

Bryan Kadzban bryan at kadzban.is-a-geek.net
Tue May 16 11:01:19 GMT 2006


joe kibz wrote:
> The Code:
> 
>   The application : dialog based MFC
> 
>   The decalaration:
>   DWORD WINAPI do_pktcapt_loop(LPVOID lp){ //is the thread method}
> 

The declaration's wrong.  ;-)

The CreateThread documentation says that your thread proc's signature
needs to be:

DWORD CALLBACK whatever(LPVOID lp)

while yours is:

DWORD WINAPI whatever(LPVOID lp)

(You're using the wrong calling convention.  But at least you're not
returning void!)

Also, depending on your compiler, it may be necessary to add an & before
your do_pktcapt_loop in the CreateThread call.  I don't think so (try
changing WINAPI to CALLBACK first), but it's possible.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://www.winpcap.org/pipermail/winpcap-users/attachments/20060516/89875851/signature.pgp


More information about the Winpcap-users mailing list