[Winpcap-users] Re: error when compiling pcap_loop in MFC

Gianluca Varenni gianluca.varenni at cacetech.com
Mon May 8 14:32:56 GMT 2006


you should declare your method as 

void __cdecl foo(....), in order to adapt to the calling convention used by wpcap.dll.

Moreover, I would suggest you to use pcap_next_ex instead of pcap_loop/pcap_dispatch, they are usually much easier to handle when you need to terminate your capture thread (I suppose you are using a separate thread for capturing in your MFC application).

Have a nice day

  ----- Original Message ----- 
  From: joe kibz 
  To: winpcap-users at winpcap.org 
  Sent: Monday, May 08, 2006 2:28 AM
  Subject: [Winpcap-users] Re: error when compiling pcap_loop in MFC

  Problem : when using pcap_loop i keep getting this error ;

  C:\joekibz\sniffere\sniffereDlg.cpp(304) : error C2664: 'pcap_loop' : cannot convert parameter 3 from 'void (unsigned char *,const struct pcap_pkthdr *,const unsigned char *)' to 'void (__cdecl *)(unsigned char *,const struct pcap_pkthdr *,const uns

  What is all that (_cdecl*) error ? and how can i debug it ?


  Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.


  Winpcap-users mailing list
  Winpcap-users at winpcap.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20060508/2d88a6b6/attachment.htm

More information about the Winpcap-users mailing list