Dirk said:
Can anyone tell me what the best way is to prevent an application from
starting up twice.
You cannot prevent it from starting up twice if your OS allows that.
However, you can try to avoid letting your application proceed far
beyond the startup code if you can determine that another copy of your
application is already running. The only standard C++ way I know is
to check if there exists a file in a predetermined location and when
the application starts, and if it does, exit, and if it doesn't, create
one to indicate that your application is the first one. The application
that creates the file shouldn't forget to delete it when it closes.
If you want something that doesn't involve creating files, you need
a platform-specific solution. Ask in a newsgroup dedicated to your
platform.
Victor