![]() |
v2.40
|
|
This page describes the design of Renga's plugin system and contains the instructions to help you author Renga plugins. Please see the sample plugin implementations in [RengaCOMSDK dir]/Samples
.
A basic Renga plugin consists of:
.rndesc
extension, which contains plugin description and loading instructions.Each description file should be placed into its own subdirectory in the ‘Plugins’ subdirectory of Renga's installation folder. Names of the description file should match the plugin's folder name. For example, for a plugin located in [RengaInstallation]/Plugins/Sample
folder, the description file should be [RengaInstallation]/Plugins/Sample/Sample.rndesc
.
All plugins are loaded into the Renga process on application start and are unloaded on exit.
The plugin description file contents are as follows:
The requirements to start using the API are as follows:
To create your own plugin in C#, create a new class library project in Microsoft Visual Studio.
To use the Renga system API, you must add a reference to the Renga COM component. You can do this in two ways:
Attention: The reference to the Renga type library must have the "Embed interop types" property set to False. This is necessary for the interop assembly to be generated when building the plugin. The reason is that the Renga .Net SDK libraries also depends on this assembly.
To create a .Net Framework plugin, you need to add a reference to Renga.NET.PluginUtility.dll
to your project. To create a .Net 8 plugin, you need to add a reference to Renga.NET8.PluginUtility.dll
from the [RengaCOMSDK dir]/Net
folder.
In the library, add a class that implements the Renga.IPlugin
interface (both explicit and implicit implementations are supported).
The interface has two methods to implement in the plugin:
bool Renga.IPlugin.Initialize(string pluginFolder)
, which is called on plugin initialization;void Renga.IPlugin.Stop()
, which is called when the plugin is being unloaded.To create your own plugin in Visual C++, create a new dynamic-link library (DLL) project in Microsoft Visual Studio.
To generate API types from Renga Type Library add #import <RengaCOMAPI.tlb>
to your code. This directive should be placed before any Renga C++ SDK headers or any other headers that use Renga API types.
In the library, add a class implementing plugins::IPlugin
. It has two methods to implement in the plugin:
bool plugins::IPlugin::initialize(const wchar_t* pluginPath)
, which is called on plugin initialization;void plugins::IPlugin::stop()
, which is called when the plugin is being unloaded.Then place the EXPORT_PLUGIN(YourPluginClassName);
macro after the plugin class declaration.
You need to place the plugin's description file into the corresponding directory of Renga's installation (see the Plugin system overview section above). Any other files, including the plugin binary itself, may be placed arbitrarily. Renga locates the binary file depending on the path stated in the PluginFilename
tag of the description file.
Remember to deploy the Renga.NET.PluginUtility.dll
assembly (for .NET Framework plugins) or Renga.NET8.PluginUtility.dll
assembly (for .NET 8 plugins) and any other resources your plugin might depend on.
You may also want to create your own installer for the plugin. In this case, you should determine the location of the Renga installation.
You can determine it using the "InstallLocation" attribute in the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{5129DC7E-FC1E-45DD-B9C9-82940798C85E} for Renga Standard HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{AD5DA106-F1CF-453A-9E44-510164E2F932} for Renga Professional
If some errors prevent the plugin from loading successfully, you can check the application log for details. The log is stored in localappdata%\Renga Software\Renga\AecApp.log
.