This shows you the differences between two versions of the page.
|
developer:zoorhinoplugin [2012/05/23] dale |
developer:zoorhinoplugin [2012/05/23] (current) dale |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Creating Rhino C++ Plug-ins that use the Zoo ====== | ||
| + | > **Developer:** //[[developer:zoo|Zoo 5.0]]// | ||
| + | > **Summary:** //Discusses how to create Rhino 5.0 plug-ins that can obtain licenses from the Rhino license manager and the Zoo.// | ||
| + | |||
| + | ===== Overview ===== | ||
| + | Zoo 5.0 allows 3rd party plug-in developers to add licensing support for their products to the Zoo. | ||
| + | |||
| + | The Rhino 5.0 C++ SDK allows developers to write plug-ins for Rhino that use the Rhino license manager and obtain licenses from Zoo servers. | ||
| + | |||
| + | |||
| + | ===== Requirements ===== | ||
| + | Rhino C++ plug-ins are MFC dynamic link libraries. Thus, to create a plug-in for Rhino, you will need one of the following development tools: | ||
| + | |||
| + | - Microsoft Visual C++ 2005 (required for Rhino 5.0 32-bit) | ||
| + | - Microsoft Visual C++ 2010 (required for Rhino 5.0 64-bit) | ||
| + | - [[http://wiki.mcneel.com/developer/sdksamples/rhino5wip|Rhino 5.0 C++ SDK]] | ||
| + | |||
| + | Note, the Express Editions of Microsoft Visual Studio will **not** work, as they do not include MFC. | ||
| + | |||
| + | Also, all Rhino plug-ins that use the Rhino license manager to access the Zoo must be signed with an Authenticode certificate issued by McNeel Plug-in Security. These certificates are free, but must be requested by each developer. Developers must agree to the //Terms of Use// before a certificate is issued. For more information on plug-in signing, see the following: | ||
| + | |||
| + | [[developer:digital-signatures/create-request|Digitally Signing Plug-ins]] | ||
| + | |||
| + | ===== Creating a Rhino C++ Plug-in ===== | ||
| + | The following are the general steps required to create a Rhino plug-in. | ||
| + | - Make sure you have the [[http://www.rhino3d.com/nr.htm|Rhino 5.0]] installed. | ||
| + | - Make sure you have the [[http://wiki.mcneel.com/developer/sdksamples/rhino5wip|Rhino 5.0 C++ SDK]] installed. | ||
| + | - Launch Microsoft Visual Studio 2010. | ||
| + | - Create a new project, in C++, based on the **Rhino 5.0 Plug-in** project template. | ||
| + | - Build your plug-in. | ||
| + | - Launch Rhino and use **PlugInManager** to install your plug-in (to verify that it was built properly). | ||
| + | |||
| + | ===== Adding Licensing Support to your Plug-in Project ===== | ||
| + | After you have built and tested your basic plug-in, 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 **CRhinoLicenseValidator**. | ||
| + | - Override the **CRhinoLicenseValidator::ProductBuildType** virtual function and return the build type of the license that your product requires. | ||
| + | - Override and implement the **CRhinoLicenseValidator::ValidateProductKey** virtual function. Rhino will call into this function whenever it needs your plug-in 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 example Rhino C++ plug-in listed below. | ||
| + | - Create one (and only one) static instance of your object. | ||
| + | - In your plug-in's **CRhinoPlugIn::OnLoadPlugIn ** member, call **CRhinoPlugIn::GetLicense** to get a license. | ||
| + | - Build your plug-in. | ||
| + | - [[developer:digital-signatures/create-request|Digitally sign your plug-in.]] | ||
| + | - Launch Rhino and test your plug-in. When your plug-in is loaded for the first time, you will be prompted to enter a license. | ||
| + | {{:developer:licensenotfound.png|}} | ||
| + | |||
| + | ===== Managing your License ===== | ||
| + | Rhino plug-ins that use the Rhino license manager appear in the Licenses page of the Options dialog. Here, the user is allowed to view and manage the license. | ||
| + | |||
| + | {{:developer:licensetools.png|}} | ||
| + | |||
| + | ===== Rhino Plug-in Sample ===== | ||
| + | {{:developer:testrhinoplugincpp.zip|Sample Rhino 5.0 C++ plug-in}} | ||
| + | |||
| + | \\ | ||
| + | |||
| + | {{tag>Developer zoodev}} | ||