How to know CRhinoCommand::result from Rhino.RhinoApp.RunScript() ? (C++/Rhino5)

I know the return value of RunScript() is true or false, but how to know a result is success / cancel / nothing … .

My code is below.

bool Result = RhinoApp().RunScript( L"! _-MyDrawLine", 0 );

//how to know this result ?
enum result
success = 0, // command worked
cancel = 1, // user canceled command
nothing = 2, // command did nothing but cancel was not pressed
failure, // command failed (bad input, computational problem, etc.)
unknown_command, // command not found (user probably had a typo in command name)
exit_rhino = 0x0FFFFFFF // exit Rhino.

To the command result of a scripted command, you will need to create a CRhinoEventWatcher object and watch for the OnEndCommand event. The event will tell you which command is ending and what the command result was.

This example demonstrates how to create a use an event watcher.

Note, you don’t need to override every event - just OnEndCommand()…

Thank you for help !