Link to home
Start Free TrialLog in
Avatar of pcasxd0
pcasxd0

asked on

Ping question

I have an IP address. If I want to ping it, can I do it by using 'WinExec' or 'ShellExecute' in my program? That is, without having to write the ping functionality myself? I just want to get the ping response time, and some simple data like that. How should I go about doing this?
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of faster
faster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Although, if you use a Win32 platform, CreateProcess() is the correct way to go.  It also gives you more flexibility.
Avatar of pcasxd0
pcasxd0

ASKER

I tried to use CreateProcess(), with my IP address as the lpApplicationName parameter and "ping" as the lpCommandLine parameter, with all the other parameters default. But I am getting an unhandled exception. Any ideas?
Thanks
Put them both in one string and use it as one of the arguments.
Avatar of pcasxd0

ASKER

Thanks, I realized that that is what I have to do, after I added the comment. I am increasing the points to 100, so that alexo, who also helped me gets points. Please give the experts 50 points each. Thanks again.
Duh!  You just gave fater 100 points and zero to me.
The process of grading is fully automated.  It is impossible to divide the points between experts.  "There can be only one"...
The usual approach is either to create a dummy question titled "for <name> only" containing text such as "for your help in question <...>".
Otherwise, you can ask Linda from customer support to do some creative point juggling (ask a 0-point question in the "experts exchange" forum).
alexo,
Look for the question in this topic area to award you an equal number of points.


Thank you.