|
 |
|
|
Hello
I have two programs which run fine using WinPCap. (Packetyzer (www.packetyzer.com) and this tool: http://www.codeproject.com/KB/IP/apptraffwatcher.aspx[^])
But your application does not even list the network adapter in the last tab. It simply does not show anything (traffic = 0)
When starting it the second time it tells me: "Could not open Adapter in CPacket::Open()" and instead of letting me configure the program it closes. (a maldesign)
Elmü
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hi !
I am using Windows Server 2003 x64 Edition and it does not work; "could not open Adapter in CPacket::Open()". I've installed PCap 4.0, which support x64 and wireshark/ethereal is working. Too much interop in that project?
Best regards, Manfred
Ciao, mb
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
How to Compile in VC++ 6?
STEP 1. first, Convert workspace VC++7 to VC++6(.dsw, .dsp) - You can use prjconverter from "http://www.codeproject.com/tools/prjconverter.asp" to convert the project to a VC++ 6 project
STEP 2. DOWNLOAD PSDK(Windows Server 2003 SP1 Platform SDK) and install - we can download PSDK from http://www.microsoft.com/downloads/details.aspx?familyid=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en
STEP 3. Run VC++ and load this project workspace file(trafficwatch.dsw)
STEP 4. Change VC++ Environments - we have to include INCLUDE and LIB folder of PSDK a. select menu on VC++ : "Tools -> Options..." b. select "Directories" on options tab control (1) select "Include Files" on combobox "Show directories..." (2) find and select PSDK INCLUDE folder (ex) "C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\INCLUDE" (3) we must move to first position this path item (4) select "Library Files" on combobox "Show directories..." (5) find and select PSDK LIB folder (ex)C:\PROGRAM FILES\MICROSOFT PLATFORM SDK\LIB (6) click "OK"
STEP 5. Now, edit some source code - because it is VC++ 7 based project a. When compiling I get the error : "c:\program files\microsoft platform sdk\include\wspiapi.h(45) : error C2265: '' : reference to a zero-sized array is illegal " [Resolution] : Try to define _WSPIAPI_COUNTOF before #include "Ws2tcpip.h" (maybe,it is appear 3 times) (ex) #define _WSPIAPI_COUNTOF //here #include "Ws2tcpip.h"
b. error C2039: 'Trim' : is not a member of 'CString' [Resolution] : Trim() function is not a member of 'CString' we need to replace this function by TrimRight() and TrimLeft() (ex) lat = atof(answer.Right(answer.GetLength()-index-4).Trim()); To: CString str = answer.Right(answer.GetLength()-index-4); str.TrimLeft(); str.TrimRight(); lat = atof(str);
c. error C2039: 'GetCount' : is not a member of 'CArray' [Resolution] : GetCount() function is not a member of CArray we have to replace this function by GetSize()
(ex) for (int i=0; i<m_longitude.GetCount(); i++) To: for (int i=0; i<m_longitude.GetSize(); i++)
STEP 6. excute WinPcap_2_3_nogui.exe (Project source folder) for copy wpcap.dll to system32 foder
STEP 7. OK!! Now is the time to built and test 
have a good time!!
-- modified at 5:17 Thursday 27th April, 2006
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
Thanks for your comment. I was unable to compile a program I wrote that included the WS2tcpip.h header file in VC++ 6. The compiler was complaining with:
wspiapi.h(45) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal
That is, unless I got the tip to define _WSPIAPI_COUNTOF from your comment. Now it compiles.
Thanks again. Cheereo.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
change following lines: in Packet.CPP "Adapters[nAdapterCount].AdapterString = "\\Device\\Packet_" + Adapters[nAdapterCount].AdapterString;" to "Adapters[nAdapterCount].AdapterString = "\\Device\\NPF_" + Adapters[nAdapterCount].AdapterString;"
"BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp);" to "BOOLEAN PacketGetNetInfoEx(LPTSTR AdapterName, PULONG netp, PULONG maskp);"
To compile use then new Libraries from WinPCap 3.1
Mfg Druschel
-- modified at 7:53 Wednesday 19th April, 2006
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
i want to view the exach and every classification which was in your project.please send the example website accourding to your classification like mail,mail filtering etc
erfrg
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
inside HICON CWinproc::GetTaskBarIcon(){ ... call this when u finish
DeleteObject(m_TaskBarIconInfo.hbmMask); DeleteObject(m_TaskBarIconInfo.hbmColor);
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I have tried to compile some of the examples in the wpcap-packet with Visual C++ 6.0, but it didn't go. Would You help how to configure the visual c++ to work with the wpcap-libraries Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi all, I downloaded the software and compile, run on my pc (win2003) my main board is multi thread, I got the error message: Could not open adapter in Cpacket.Open
I can run this application in win2000 and win2003 (on the pc don't have multi thread mainboard.)
could any one help me?
|
| Sign In·View Thread·PermaLink | 1.88/5 (7 votes) |
|
|
|
 |
|
|
You can use the Netmon packet driver that comes in Windows and more noteably the IRTC real time capture interface.
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
it reported "H:\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include/l.deu\afxres.rc(93) : fatal error RC1004: unexpected end of file found".
i have compiled it successfully under vc7 (vs .net 2002).
pls tell me what to do now, thank you!
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
i copy iphlpapi.h to the directory,but another question occured in vc6.0
e:\all\c\04.5\trafficwatcher\trafficwatch_src\toolpage.h(14) : fatal error C1083: Cannot open include file: 'PSAPI.H': No such file or directory
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
Under Win-ME the program seems to rely on Windows NT's PSAPI.DLL. When I add this DLL, there is always reported some broken link to stricmp_ function.
Under Windows 2000 everything works fine.
Do you have any hints?
Best Regards Stefan
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
When Windows ME was released I rushed down to my local PC World to get a copy. It had only been released for no more than a week. When I was talking to the sales assistant he mentioned he got it as soon as it was released and he'd installed it and it broke everything on his PC and that I should buy something else. Subsequently I spent my money on some other stuff instead. That was the first and last time I have ever received good advice from a member of PC WORLD staff.
--Colin Mackay--
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
i converted trafficwatch.sln to trafficwatch.dsw, then build:
--------------------Configuration: trafficwatch - Win32 Debug-------------------- Compiling... AboutPage.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory DetailPage.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory HistoryPage.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory IPStat.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory MainSheet.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory NetGeoClient.cpp D:\Work\TrafficWatch_src\NetGeoClient.cpp(87) : error C2039: 'Trim' : is not a member of 'CString' e:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' D:\Work\TrafficWatch_src\NetGeoClient.cpp(92) : error C2039: 'Trim' : is not a member of 'CString' e:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' OptionsPage.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory Packet.cpp d:\work\trafficwatch_src\packet.h(7) : fatal error C1083: Cannot open include file: 'ntddndis.h': No such file or directory PortStat.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory ToolPage.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory TrafficPage.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory TrafficView.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory WorldView.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory trafficwatch.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory winproc.cpp d:\work\trafficwatch_src\trafficpage.h(12) : fatal error C1083: Cannot open include file: 'iphlpapi.h': No such file or directory Generating Code... Error executing cl.exe.
trafficwatch.exe - 16 error(s), 0 warning(s)
thanks!
|
| Sign In·View Thread·PermaLink | 2.00/5 (3 votes) |
|
|
|
 |
|
|
 |
|
|
i can't find 'iphlpapi.h' in my computer.
the post you listed told people to poll up the including directory to the top of the list, but i can't even find the file in my computer.
so i want to know IS IT NECESSARY TO INSTALL SDK?
i've compiled it successfully under vc7 before i posted my first question.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
smn wrote: i can't find 'iphlpapi.h' in my computer.
Yes, a more recent SDK than the one that comes with VC6 is needed. You could use the one from VC7...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Well, looks like a great util, but just won't work.
Quite an adventure. First, had to convert the project from v7 to v6 (thanks, prjconverter).
Then had to get the psapi.h and .lib and all other by hand since didn't want to download 1Tb SDK from MS. So far, all this is my own choice, you might argue.
Then applied some of the fixes found in the discussions. But I found the programming rather sloppy. Just take the following :
DWORD value, valuesize; ULONG type; valuesize = sizeof(value); if (!RegQueryValueEx(hKey, "adapter", 0, &type, (un... etc value = -1; if (m_ipStat.init(value) == FALSE)
Well, DWORD is an unsigned. I do understand that assigning "-1" to it will (probably) end up doing the right thing, and then using it to call the .init with -1 will end up doing the right casting too. But sloppy, fraught with danger.
Take too the call CPacket::Open(). It returns an LPADAPTER. Yes it is used to return a BOOL in the CIPStat::init() call. Not on, should be at least 'return CPacket::Open(ind) != (LPADAPTER)NULL'.
Very loose type casting leads to assumptions, subtle problems of the kind found throughout the discussions on this utility.
Anyways, bottom line here is that the WinPCap's PacketOpenAdapter() keeps returning NULL for me. All values in Adapters[0] look good, including .AdapterString, but to no avail. Once I removed the "Packet_" from the device string, and it worked just this once. Then it failed, even after rebooting (???). This is XP Pro on a single-adapter board, BTW.
Disappointing, but I can see that the author did a great deal of fine research in all this.
PC.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
hai, I downloaded the project and complied and it reported that the ntddndis.h File is missing. Can any one help me out?.Can any one suggest me where i can get this header.?
Rashvi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |