I have a Windows C ++ service that sometimes crashes when I call the system () function to issue a command. I ran the exact command text on the Windows command prompt and it works fine, but for some reason it fails when system () starts.
To make matters worse, I cannot get any information about why system () is not working. It does not seem to throw an exception because I am doing a catch (...) and they will not catch anything. My service just stops working. I know this is a system call () that fails because I put the registration information before and after the call, and something after it just writes nothing.
So, is there any other way so that I can execute the command? At least something that will give me some information if things go wrong, or at least let me handle the exception or something else.
source
share