Lists,您好!
you can declare the function
CALLBACK
======= 2003-05-28 11:27:00 您在来信中写道:=======
>I am trying to convert a command line app to Windows MFC Application
>(Microsoft Visual C++).
>
>The setup works fine and I see the device I want:
>TRACE(d->description);
>
>But it is like the packet_handler(...) is never being called???
>I step through with the debugger and it goes:
>TRACE("\nCapture Start 0a");
>TRACE("\nCapture Start 0b");
>It is like it just skips the call to pcap_loop(adhandle, 0,
>(void)packet_handler, NULL);
>
>Any one have any advice on this or an Windows MFC sample?
>Thnak you
>
>My code ...
>
>void ClinksysMFCView::OnInitialUpdate()
>{
> //set up the device, etc. works fine
> TRACE(d->description); //<- I see the device so works fine
> //...
> //start the capture
> TRACE("\nCapture Start 0a");
> pcap_loop(adhandle, 0, (void)packet_handler, NULL);
> TRACE("\nCapture Start 0b");
>}
>
>void packet_handler(unsigned char *param, const struct pcap_pkthdr *header,
>const unsigned char *pkt_data)
>{
> TRACE("\nIn Packet Handler");
> //...
>}
>
>I get:
> TRACE("\nCapture Start 0a");
> TRACE("\nCapture Start 0b");
>and that is it -- no TRACE("\nIn Packet Handler");
>
>Note -- all works fine in a command line app
>
>
>
>
>==================================================================
> This is the WinPcap users list. It is archived at
> http://www.mail-archive.com/[EMAIL PROTECTED]/
>
> To unsubscribe use
> mailto: [EMAIL PROTECTED]
>==================================================================
= = = = = = = = = = = = = = = = = = = =
致
礼!
gouguijia
[EMAIL PROTECTED]
2003-05-30
================================================================= This is the WinPcap
users list. It is archived at
http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe use
mailto: [EMAIL PROTECTED]
=================================================================