Creating Zoo Plugins
This guide discusses how to create plugins for Zoo using C/C++
Zoo lets third party plugin developers add licensing support for their products to the Zoo.
The Rhino C/C++ SDK allows developers to write plugins for Rhino that use the Rhino license manager and obtain licenses from Zoo servers.
When a customer attempts to add a product license to the Zoo, the product’s plugin is called to validate the user’s request. Upon validation, the plugin will return the product’s licensing information back to the Zoo. In turn, the Zoo will serialize, maintain, and distribute this license.
Rhino C/C++ plugins are MFC dynamic link libraries. Thus, to create a plugin for Rhino, you will need one of the following development tools:
- Microsoft Visual C++ 2017 (required for Rhino 6.0 64-bit)
- Rhino 6.0 C/C++ SDK
NOTE: Express Editions of Microsoft Visual Studio will not work, as they do not include MFC.
Writing a Rhino Plugin
The general steps required to create a Rhino plugin are:
- Make sure you have Zoo installed.
- Make sure you have the Rhino installed.
- Make sure you have the Rhino C/C++ SDK installed.
- Launch Microsoft Visual Studio 2017.
- Create a new project, in C/C++, based on the Rhino 6.0 Plugin project template.
- Build your plugin.
- Launch Rhino and use the PlugInManager command to install your plugin (to verify that it was built properly).
Adding Licensing Support
After you have built and tested your basic plugin, you can add licensing support as follows:
- Add a new .cpp file to your project.
- In this .cpp file, declare a new class that is derived from
- Override the
CRhinoLicenseValidator::ProductBuildTypevirtual function and return the build type of the license that your product requires.
- Override and implement the
CRhinoLicenseValidator::ValidateProductKeyvirtual function. Rhino will call into this function whenever it needs your plugin to validate a license that is entered by a user, returned by the Rhino license manager (standalone node), or returned from a Zoo server (network node). For details, see the sample Rhino C/C++ plugins in Related Topics below.
- Create one (and only one) static instance of your object.
- In your plugin’s
CRhinoPlugIn::GetLicenseto get a license.
- Build your plugin.
- Digitally sign your plugin.
- Launch Rhino and test your plugin. When your plugin is loaded for the first time, you will be prompted to enter a license.