Handling failure to load plugin

Hello,

I am improving our handling of a failure to load our C# plugin in Rhino 5, not a very high-priority task, but something which needs to be in place nonetheless.

The current case I am handling is mostly supporting our internal users, who sometimes copy dlls manually, and sometimes mess that up. At the moment, I detect if the main dll is missing, open a dialog to say so, and fail to load gracefully.

Unfortunately, my dialog opens behind the Rhino splash screen, and if the mouse is over this, the user may not see it, as they wait for the plugin to load. Is there some way to get the handle of the splash screen window, or other way to pop my dialog to the top?

If the splash screen is allowed to close, and they click Ok on my dialog, the plugin has then failed to load, but the Iray viewport renderer menu entry is still there, and the Iray toolbar is still loaded. Is there something we can do to stop this, i.e. to load no components of our plugin, if the main plugin fails to load?

Thanks for any hints.

Hi Carsten,

To “kill” the splash screen, call Rhino.UI.Dialogs.KillSplash().

– Dale

Thanks, I will try that.

Any way to remove the inactive UI elements?

One more question: when a plugin fails to load, you pop up a dialog reporting this, and there is a Details button for more information. Our information is very sparse, and if possible, I would like to improve that. Is there some way to poke in a link to our log file, for example?

It appears that the RMA.Rhino.MRhinoPlugInAttributes class does not have room for this type of information. I have replaced the Website link with one to our support forums for now.

I’m not sure what this means. Can you explain further what you want to do an why?[quote=“CarstenW, post:4, topic:36545”]
Is there some way to poke in a link to our log file, for example?
[/quote]

Currently no. The “details” page is supposed to show your developer info, as found in your assembly. But that assumes we were able to load your plug-in.

This is a Rhino_DotNet class, not a RhinoCommon class.If you want to modify this type of info, just edit your project’s AssemblyInfo.cs file.

I’m not sure what this means. Can you explain further what you want to do an why?

When our plugin doesn’t load, there is still the “Iray” entry in the viewport renderer dropdown menu (I don’t recall if the toolbar also shows). I would like to remove this when we couldn’t load.

Of course, the plugin didn’t load, so maybe we don’t have a code path, but maybe there is a way?