views:

82

answers:

2

I have a Program which is written in C++. It is a program which needs to be restarted when network connection is lost ...

I have written program code which is pinging IP and I'm stuck on that ...

Can anybody show me the code for the next step

Thank you beforehand.

A: 

You need to create a separate program which monitors your program, and starts it if it stops.

Lars D
can you write code of that program ??? i tried smt like that and it didn't worked
Tornike
A: 

It's been a while since I wrote C++, so I'll present this as pseudo code:

if (network connection lost)
{
    Process.Start("C:\Program Files\This Program\program.exe");

    // exit this application
}

C++ Process.Start documentation

ChrisF