v2.3
How to implement a plugin

Overview

This page describes the design of Renga's plugin system and contains the instructions to help you author Renga extensions. Please see the sample plugin implementations in [RengaCOMSDK dir]/Samples.

Plugin system overview

A basic Renga plugin consists of:

  • the plugin's binary file, which is a regular Windows dynamic-link library or a .NET assembly.
  • the description file - an XML file named with the .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.

Description file contents

The plugin description file contents are as follows:

1 <RengaPlugin>
2  <Name>Sample Plugin</Name> <!-- Displayed plugin name -->
3  <Version>1.0</Version> <!-- Plugin version -->
4  <Copyright>Copyright text</Copyright> <!-- Copyright information -->
5  <RequiredAPIVersion>2.3</RequiredAPIVersion> <!-- Minimum required version of Renga API -->
6  <PluginType>net</PluginType> <!-- Plugin type. Use "net" for .NET (C#, C++/CLI) and "cpp" for Visual C++. Optional, defaults to "cpp" -->
7  <PluginFilename>Sample.dll</PluginFilename> <!-- Path to the plugin's binary file, either relative to the folder containing the .rndesc file or an absolute one -->
8  <Vendor>Renga</Vendor> <!-- Vendor of the plugin -->
9 </RengaPlugin>

What do I need to use the Renga API?

The requirements to start using the API are as follows:

  • An installed copy of Renga Architecture, Renga Structure or Renga MEP;
  • Renga Software Development Kit (download);
  • Microsoft Visual Studio 2012 or newer. Sample projects were created in Visual Studio 2015, however you can use an older version.

How to create a new plugin in C#

In order to create your own plugin in C# create a new class library project in Microsoft Visual Studio.

In the library add a class implementing 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.

How to create a new plugin in C++

In order to create your own plugin in Visual C++ create a new dynamic-link library (DLL) project in Microsoft Visual Studio.

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.

How to install a plugin

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 plugins) and any other resources your plugin might depend on.

If the plugin doesn't load

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 Architecture/AecApp.log.