Using pcap.net with C++

Dec 1, 2011 at 1:50 PM
Edited Dec 2, 2011 at 6:42 AM

I recently came across Pcap.Net while searching something related to WinPcap and found that it is very interesting. I am trying to use Pcap.Net with Visual C++ instead of C#. However, I am not sure on how to use the library correctly.

In C# we have (sample code)

using PcapDotNet.Core;

PcapDotNet.Analysis.PcapDotNetAnalysis.OptIn = true;

 

 

How should i accomplish this in VC++? Is it something like this?

 

#include <PcapDotNet.Core>

PcapDotNet->Analysis->PcapDotNetAnalysis->OptIn = true;

 

 

I hope someone could clarify these minor things. The rest would be easy as there is a good documentation on using the classes. I noticed all documentation are written in C#. Thank you.

Coordinator
Dec 2, 2011 at 5:14 PM

Hi valthyx,

 

I suggest learning the basic syntax of C++/CLI.

For example, you can access sub namespaces, inner classes or static methods using double colon ("::") instead of a period (".").

 

I hope this helps,

 

Boaz.