Restarting a Program (via restarting process or making new one)
I am using Visual Studio. I have a program which calls a function that can fail (Bluetooth initialization, closed source). If this certain function fails, then I'll need to restart the process. I found this way to do it from MSDN:
However, I believe this is a Windows library function. It works, but the .exe filename can change sometimes. I know there is a __FILE__ macro predefined, but this only gets the source file of the main(). What is a better way to restart the process without needing to know the .exe ?