Enabling/Disabling Plug-Ins

These routines are used to work with plug-ins and manage them. Most plugins will not need to use these APIs.


XPLMIsPluginEnabled

function

Returns whether the specified plug-in is enabled for running.

XPLM_API int        XPLMIsPluginEnabled(
                         XPLMPluginID         inPluginID
                    );

XPLMEnablePlugin

function

This routine enables a plug-in if it is not already enabled. It returns true if the plugin was enabled or successfully enables itself, false if it does not. Plugins may fail to enable (for example, if resources cannot be acquired) by returning false from their XPluginEnable callback.

XPLM_API int        XPLMEnablePlugin(
                         XPLMPluginID         inPluginID
                    );

XPLMDisablePlugin

function

This routine disables an enabled plug-in.

XPLM_API void       XPLMDisablePlugin(
                         XPLMPluginID         inPluginID
                    );

XPLMReloadPlugins

function

This routine reloads all plug-ins. Once this routine is called and you return from the callback you were within (e.g. a menu select callback) you will receive your XPluginDisable and XPluginStop callbacks and your DLL will be unloaded, then the start process happens as if the sim was starting up.

XPLM_API void       XPLMReloadPlugins(void);

XPLMReloadThisPlugin

function XPLM440

This routine reloads the plug-ins which calls it. If you pass true for 'forReplacement', a dialog will be shown after the .xpl has been unloaded to allow you to replace it with a newer one manually. In other respects it works identically to XPLMReloadPlugins().

XPLM_API void       XPLMReloadThisPlugin(
                         int                  forReplacement
                    );