First     Previous     Next

Creating the object

The first thing FL Studio does when the user selects a plugin, is load the CreatePlugInstance function. Therefore, this function has to be exported from the dll. In the examples, this is done in the plugin unit/module.

Inside CreatePlugInstance, there are two things to be done. First, set the global PlugHost variable to the Host parameter of the function. After that, create your plugin and return it as the result of the function.

Make sure that the HostTag member of your plugin class is set to the Tag parameter of CreatePlugInstance. You can do this either inside this function (after your class has been created), or in the constructor of your class (like in the examples). Also set the Info field of the plugin class to point to a valid TPlugInfo structure. If this value is invalid, your plugin will not be loaded.