Ping Utility for Windows CE


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

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)


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


  • Newer SDKs use IPHLPAPI.LIB instead

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

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

  • Ping

    Posted by Legacy on 01/29/2004 08: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 07: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

  • missing files

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

    Originally posted by: Oscar Raig

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


  • I need the full project...

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

    Originally posted by: ctong

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

    Thanks, Calvin

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

    Posted by Legacy on 12/01/2003 08: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?

  • OK but only for Release

    Posted by Legacy on 11/28/2003 08: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"

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

    Posted by Legacy on 10/29/2003 08: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


  • Pls send me ping code for pocket PC

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

    Originally posted by: venkat


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

    Thanks in advance

  • Help needed with a full working project

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

    Originally posted by: srinivass


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


  • missing exports?

    Posted by Legacy on 06/25/2003 07: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

    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
    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


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

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

  • Loading, Please Wait ...

  • You must have javascript enabled in order to post comments.

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

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date