<DIV>Hi guys,</DIV> <DIV> </DIV> <DIV>I'm trying to store the packets captured to "savefile" using pcap_dump_open and pcap_dump functions. Both these functions use pointer to pcap_dumper_t structure called dumpfile. </DIV> <DIV> </DIV> <DIV>I'm working in Visual Studio .NET 2003 MFC Console application (.NET). And I'm getting following assembly error:</DIV> <DIV><STRONG>An unhandled exception of type 'System.TypeLoadException' occurred in Unknown Module.</STRONG></DIV> <DIV><STRONG>Additional information: Could not load type pcap_dumper from assembly try, Version=1.0.2303.25936, Culture=neutral, PublicKeyToken=null.</STRONG></DIV> <DIV> </DIV> <DIV>The error points to </DIV><FONT size=2> <DIV>mainret = main(argc, argv, envp);</DIV></FONT> <DIV>in crtexe.c file.</DIV> <DIV> </DIV> <DIV>This is the related piece of code:</DIV><FONT size=2> <DIV>pcap_dumper_t* dumpfile;</DIV></FONT><FONT color=#0000ff size=2> <DIV>char</FONT><FONT
size=2>* tmpdir;</DIV></FONT> <DIV>.</DIV> <DIV>.</DIV><FONT color=#000000 size=2> <DIV>tmpdir = strdup(tmpnam(NULL));</DIV></FONT><FONT size=2> <DIV>dumpfile =pcap_dump_open(adhandle,"dumpfile"); >>>adhandle is return value </DIV> <DIV> >>of pcap_open structure</DIV> <DIV></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>(dumpfile==NULL)</DIV> <DIV>{</DIV> <DIV>fprintf(stderr,"\nError opening output file\n");</DIV> <DIV></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> -1;</DIV> <DIV>}</DIV></FONT>
<DIV>.</DIV> <DIV>.</DIV><FONT size=2> <DIV>pcap_loop(adhandle, 0, packet_handler, (</FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> *)dumpfile);</DIV></FONT> <DIV>.</DIV> <DIV>.</DIV> <DIV>I'm unable to debug this. All other functions work fine. So I guess there is no linking error. It's only when I use pcap_dumper_t I'm getting error.</DIV> <DIV> </DIV> <DIV> </DIV><p>
        
        
                <hr size=1>
Jiyo cricket on <a href="http://us.rd.yahoo.com/mail/in/mailcricket/*http://in.sports.yahoo.com/cricket/">Yahoo! India cricket</a><br>
<a href="http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http://in.mobile.yahoo.com/new/messenger/">Yahoo! Messenger Mobile</a> Stay in touch with your buddies all the time.