How to I set my plug-in to load at startup?
Rhino will load plug-ins in two ways.
To set your plug-in to load on startup, you need to override your plug-in object's CRhinoPlugIn::PlugInLoadTime virtual function and return CRhinoPlugIn::load_plugin_at_startup.
Note, if you have already loaded your plug-in using Rhino's plug-in manager, when debugging for example, then you will need to either remove your plug-in's registry key, which can be found here:
HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\4.0\<rhino_build_date>\Plug-Ins\<your_plugin_guid>
or you can just modify your plug-in's "LoadMode" registry key value. The available values for this key are as follows:
| Load mode | Registry Value | Description |
| load_plugin_when_needed | 2 - REG_DWORD, Decimal | Default. Load the first time a plug-in command used |
| load_plugin_at_startup | 1 - REG_DWORD, Decimal | Load when Rhino is loaded |
The reason this step is required is that the "LoadMode" Registry key value is only written the first time the plug-in is loaded (when it is initially installed or registered). This will not be an issue for customers of your plug-in for the correct registry key value will be written the first time they load your plug-in.