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?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

of course you can Exec a command and redirect the output to a file, then parse the file to get what you want.  Most of your code will be spent on parsing.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Although, if you use a Win32 platform, CreateProcess() is the correct way to go.  It also gives you more flexibility.
pcasxd0Author Commented:
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?
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Put them both in one string and use it as one of the arguments.
pcasxd0Author Commented:
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).
Look for the question in this topic area to award you an equal number of points.

Thank you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.