Possible values of CRhinoCommand::RunCommand result

Hi,

I’m starting to develop a plugin in C++. I implemented a simple command which uses several CRhinoGetXXX classes to ask the user to enter some information. If, while waiting for user input, the command is stopped (either by pressing Esc. or by, for example, opening a file), I get an error window telling me that my command “did not return success or nothing”.

I did some debugging and I’m sure my command returns CRhinoCommand::cancel, which according to the help at http://wiki.mcneel.com/developer/sdksamples/addcommand should be valid.

I wouldn’t care too much if it was just a debug message (I guess it doesn’t show in Release mode), but in the case of the command being stopped by opening a file, the file is not opened at all (another - non-debug - message says the file cannot be opened because a command couldn’t be stopped)

How to solve this ?

If you are referring to this kind of dialog:

Then the behavior you describe is normal if you have the Rhino C++ SDK installed. The dialog is meant to help you ensure your commands return the proper result code. If you don’t want to see this dialog, then just follow the directions in the message box.

Thanks for the answer. I used TestErrorCheck to display errors with RhinoApp.Print instead of having a dialog box, and the file opening error disappeared.

Anyway, as you said, there will be no problem when the SDK is not there, so all is well. Thanks.