|
What can I say? Maybe it's easier for you to open a dos box and type the ping command. The whole idea is to show how to write a ping program, not how to call a ping program that someone else wrote.
|
|
|
|
|
yeah..
but i always struggled with the problem that i didn't get this (and all other ping - classes) running on win2000 (if not beeing administrator).
yeah.. and with one easy functin everything worked fine..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Hello.
This class can report wrong time when using Windows Sockets2 (Ping2) .
When sending ping's repeatdly, it doesn't recoginzes difference between
packets sent previously and next packet, because all ICMP packets have
same ID.
Cheers,
Magomed G. Abdurakhmanov
|
|
|
|
|
The latest version on my web site (www.naughter.com) has a fix for this
|
|
|
|
|
Hi all,
CPing works fine as long as I'm administrator. However, Ping2 fails when loged in as non-admin!!! GetLastError returns "Control ID not found".
Does somebody know how to get around that or can explain me this error?
Thanks a lot,
Stefan
|
|
|
|
|
Sorry the "Control ID not found" error is a remnant of a previous prog. Instead, the WSASocket(AF_INET, SOCK_RAW, IPPROTO_ICMP, NULL, 0, 0) call returns INVALID_SOCKET. WSAGetLastError returns WSAEACCES ("An attempt was made to access a socket in a way forbidden by its access permissions").
Nevertheless, where can I grant the missing permissions for non-admins???
Thanks,
Stefan
|
|
|
|
|
Solution see Kb article Q195445 (http://support.microsoft.com/support/kb/articles/q195/4/45.asp)
However, this is actually only for NT, but not W2K
|
|
|
|
|
Article is now updated for W2000
|
|
|
|
|
I know this is an old thread but wanted to reply anyway. I hope this helps someone...
You can also use the RunAs service under W2K. By default the service is running. There's several ways to use it. The 1st is to shift+right.click an executable in explorer and you will see an extra menu item called "runas...". This should be self-explanatory. Also you can right click on a shortcut or desktop icon and click properties and enable the "runas” box. I also recall a CreateProcessAsUser API function and also there is a batch command called "runas".
Ed
|
|
|
|
|
and does not respect the timeout...
|
|
|
|
|
If you are really really worried about this then do a timed out DNS lookup outside of the ping class and only send in an IP address to this class.
|
|
|
|
|
When I run the program compiled with CPING_USE_ICMP I get
"Failed in call to ping, GetLastError returns: 11010"
I need to do this cause I need to run it on win95. Am I doing something wrong?
Thanks
|
|
|
|
|
The error is:
#define WSA_QOS_ADMISSION_FAILURE (WSABASEERR + 1010)
/* error due to lack of resources */
You will have to look up on the MSDN why this is occurring. Perhaps you need to install the Winsock2 update for Win95.
|
|
|
|
|
I added the .cpp file in my project, and #include-d <afxpriv.h> and <afxsock.h>.
However, when I rebuild the project (which compiles fine before adding your file), I get:
ping.obj : error LNK2001: unresolved external symbol _WSACleanup@0
ping.obj : error LNK2001: unresolved external symbol _select@20
I'm using VC++ 6.0 Enterprise on Win98.
What do I need to do to get your stuff to build? I haven't even referenced it yet in code....
Thanks
|
|
|
|
|
You have to link ws2_32.lib
--
Alex Marbus
|
|
|
|
|
In Local Area, your ping class works great.
If host has Virtual IP Address, ping doesn't work.
traceroute works well, but your ping class doesn't work.
please give me a hand. do you know why? please help me
|
|
|
|
|
Hi !
Maybe my comment on CPing article in codeguru can help you , because I
encountered such problems ( if you interested only in virtual IP , I think , encluding it in file Hosts will sold your problem ) and using Windump understand how code must be changed . Because the algorithm
of CPing of both authors ( Robert Hamilton and PJ Naughter )
Look at my comments ( Arkady Frankel ) from on 20/11/26 and 2000/12/21 on http://codeguru.earthweb.com/internet/cping.shtml
HTH
Arkady
|
|
|
|
|
1) In the .h file add these lines:
#define ASSERT ATLASSERT
#define TRACE ATLTRACE
#ifdef _DEBUG
#define VERIFY(x) ATLASSERT(x)
#else
#define VERIFY(x) x
#endif
2) In the .h file comment out "afxpriv.h" like that:
//#ifndef __AFXPRIV_H__
//#pragma message("The class CPing requires AFXPRIV.H in your PCH")
//#endif
3) In the .cpp file comment out DEBUG_NEW
/*
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
*/
That's done folk !
Now you can use this object as is in any ATL project.
MrB - http://www.nudeSoft.co
|
|
|
|
|
I'm trying to use CPing within a thread, and I get the following error when I compile. I am using VC++ 6.0.
MyAppDlg.obj : error LNK2001: unresolved external symbol "public: int __thiscall CPing::Ping1(char const *,struct CPingReply &,unsigned char,unsigned long,unsigned char)const " (?Ping1@CPing@@QBEHPBDAAUCPingReply@@EKE@Z)
Any ideas? The function I am calling Ping1 from is declared globally. I have #include "ping.h" in the .cpp
file where the function is declared, and in the .cpp file where the function is called. Any and all help will be
appreciated!
Thanks,
Jef
|
|
|
|
|
Make sure you have the "CPING_USE_ICMP" preprocessor directive declared for the project.
P
|
|
|
|
|
Also, if you are trying to start the thread using the CPing function it will fail because threads require a C style function and CPing will have a C++ style header.
Solutions:
1) Use AfxBeginThread
2) Make a static function in CPing that takes a pointer to a CPing class as its parameter. That function should call pClassPointer->CPing(parameters).
You can start your thread with the static function.
Jame
|
|
|
|
|
Have you included ping.cpp into the project, usually helps clear up link errors for me.
|
|
|
|
|
Is it working on Windows 95 ?
I'm not sure ...
I've tested it and I have an error
|
|
|
|
|
Is it working on Windows 95 ?
I'm not sure ...
I've tested it and I have an error
|
|
|
|
|
It should work without probs on 95. The Winsock2 version will of cource need the Winsock 2 update installed as Windows 95 gold did not ship with Winsock 2 suppor
|
|
|
|