Ping Utility for Windows CE

Environment: Windows CE 2.11+, Windows 2000, Windows NT, Visual C++ 6

Unfortunately, the HPC/PPC devices (running Windows CE) lack a ping utility. Therefore, because the HPC PRO SDK (version 2.11+) does have a subset of the ICMP functions, I was able to write my CEPing utility which can be helpful for checking the connection of CE devices to other friends ( CE devices or bigger machines ) on a TCP/IP network. In the case of lack of such utility it is possible to check if CE device is in the net by standard ping utility from some 'big'( PC ) computer. I didn't produce ceping for emulation mode because of the absence of ICMP functions for emulation mode.

In CEPing, I defined only a subset of the standard ping.exe parameters for simplicity. However, it would trivial to add any omitted functionality as I'e included the complete source code here. By default, CEPing functions like the standard ping utility with -a switch specified (it tries to resolve addresses to peer computers). But, obviously, that's not always possible. Therefore, there are time when you can't see the names of peer computers on the line under IP/Name editbox. Basically, it all depends on how you have WINS defined in the network properties Control Panel applet.

The problem is that without a WINS server definition, the gethostbyname() and gethostbyaddress() functions will return NULL. Therefore, in this case, it is only possible to check the IP address of peers and not resolve the name. The result of typing correct peer name in this case is "Wrong Name" answer on ping operation.

I checked the HPC (Jornada 680) with my PC with LP-E ethernet card and Xircom card. By default, Xircom installed my PC IP as a WINS server. Here is a table which describes the behavour of the gethostbyname() and gethostbyaddress() functions in different environment (based on the definition of the WINS settings).

V = resolution exist
X = no resolution

                    No WINS server  |     WINS defined      |  Wins defined as host PC
                       defined      |  host PC | others PC  |    host PC | others PC
gethostbyname()          X          |     V          V      |       V          X
gethostbyaddress()       X          |     V          X      |       V          X

As you can see from the figure above, the results of the ping are displayed in combo box and each string contains the number of connection attempts as well as the RTT (Round Trip Timetime)

Downloads

Download project - 29 Kb
Download zipped sh3 exe - 6 Kb
Download zipped mips exe - 6 Kb
Download zipped arm exe - 6 Kb


Comments

  • Newer SDKs use IPHLPAPI.LIB instead

    Posted by bthomsen on 10/17/2008 12:33pm

    With SDKs newer than .NET 4.0, the icmplib.lib library is no longer included. Use the iphlpapi.lib library instead.

    Reply
  • Ping

    Posted by Legacy on 01/29/2004 12:00am

    Originally posted by: Frederik

    Works great. Just remember to include the winsock.lib and the icmplib.lib under project settings. Thx. Btw: I am experiencing approx. 20 seconds cost pr. single call to Ping eventhough the ping time is about 600 ms. Is that what can be expected? Any comments appriciated.

    • help

      Posted by kingjac on 04/20/2004 12:08pm

      I tried to compile the code using Embedded visual c++ 4.0 but I always get an error message that is the following: C:\Documents and Settings\Administrator\Desktop\CE_DEV\ceping.rc(189) : fatal error RC1015: cannot open include file 'res\ceping.rc2'. Error executing rc.exe. I will appreciate if you can send me all missing files or the whole code, one that will work other than the one listed here online. Thanks in advance

      Reply
    Reply
  • missing files

    Posted by Legacy on 01/16/2004 12:00am

    Originally posted by: Oscar Raig

    The resource file is missing. Please send me the full project.
    Thanks,

    Oscar

    Reply
  • I need the full project...

    Posted by Legacy on 12/15/2003 12:00am

    Originally posted by: ctong

    The resource file is missing. Please send me the full project.

    Thanks, Calvin

    Reply
  • where can I get the eVC++3.0 working code?

    Posted by Legacy on 12/01/2003 12:00am

    Originally posted by: lavino

    I get the same old:

    C:\Documents and Settings\Administrator\Desktop\CE_DEV\ceping.rc(189) : fatal error RC1015: cannot open include file 'res\ceping.rc2'.
    Error executing rc.exe.

    error... where can I download the latest code?

    Reply
  • OK but only for Release

    Posted by Legacy on 11/28/2003 12:00am

    Originally posted by: diego

    I've made a new CEPing.rc2 CEPing.ico files and it's ok bur only in release ....if i tr to compile in debug i've the following link error:
    LINK : fatal error LNK1181: cannot open input file "CE.obj"

    Reply
  • now ported to pocketpc2002, eMVc++ 3.0, everything working.

    Posted by Legacy on 10/29/2003 12:00am

    Originally posted by: Yves Jeanrenaud

    well, I just made a folder called "res" and placed there a rc2 and a ico file I borrowed form another projec.t usually, there's nothing specific in the rc2 file anyhow.
    then, I added the icmp.lib to the linker-settings, disabled the precompiled headers and then I compiled as release.
    now everything works.

    kindly regards

    yves

    Reply
  • Pls send me ping code for pocket PC

    Posted by Legacy on 09/01/2003 12:00am

    Originally posted by: venkat

    Hi,

    Pls send me ping code for pocket PC. i need it some what urgent.

    Thanks in advance
    venkat

    Reply
  • Help needed with a full working project

    Posted by Legacy on 08/18/2003 12:00am

    Originally posted by: srinivass

    Hi.,

    (Any of you in this forum ),
    Please mail me the full working project with the missing
    project because I need this very urgently.

    Thanks.,
    Srini

    Reply
  • missing exports?

    Posted by Legacy on 06/25/2003 12:00am

    Originally posted by: Hawkmoon

    Douglas Boling's book says you can just use the lib files and grab the header files from elsewhere. I had the same problem with

    error LNK2019: unresolved external symbol "int __cdecl IcmpCloseHandle(void *)" (?IcmpCloseHandle@@YAHPAX@Z) referenced in function

    rror LNK2019: unresolved external symbol "unsigned long __cdecl IcmpSendEcho(void *,unsigned long,void *,unsigned short,struct ip_option_information *,void *,unsigned long,unsigned long)" (?IcmpSendEcho@@YAKPAXK0GPAUip_option_inf
    ormation@@0KK@Z)

    Very annoying. I wasted the afternoon tracking this problem down. Glad I didn't purchase his book but instead borrowed it. =)


    C:\Windows CE Tools\wce300\MS Pocket PC\lib>"c:\program files\microsoft embedded
    tools\evc\wce300\bin\dumpbin" /EXPORTS "C:\windows ce tools\wce300\MS Pocket PC
    \lib\arm\icmplib.lib"
    Microsoft (R) COFF Binary File Dumper Version 6.20.8700
    Copyright (C) Microsoft Corp 1992-2000. All rights reserved.


    Dump of file C:\windows ce tools\wce300\MS Pocket PC\lib\arm\icmplib.lib

    File Type: LIBRARY

    Summary

    1871 .debug$S
    54 .debug$T
    35 .drectve
    18 .pdata
    1C8 .text

    C:\Windows CE Tools\wce300\MS Pocket PC\lib>

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • When it comes to desktops – physical or virtual – it's all about the applications. Cloud-hosted virtual desktops are growing fast because you get local data center-class security and 24x7 access with the complete personalization and flexibility of your own desktop. Organizations make five common mistakes when it comes to planning and implementing their application management strategy. This eBook tells you what they are and how to avoid them, and offers real-life case studies on customers who didn't …

  • Download the Information Governance Survey Benchmark Report to gain insights that can help you further establish business value in your Records and Information Management (RIM) program and across your entire organization. Discover how your peers in the industry are dealing with this evolving information lifecycle management environment and uncover key insights such as: 87% of organizations surveyed have a RIM program in place 8% measure compliance 64% cannot get employees to "let go" of information for …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds