Project

General

Profile

Actions

Basis of a new plugin (on MS Windows)

All Scol types and functions are defined in the file header "scolPlugin.h", we make these features available including this file.

#include <scolPlugin.h>

To initialize the Scol virtual machine, you must add the following line (the variable must be called absolutely "ww ", the latter being used by all functions of the SDK).

//!Scol machine declaration for MM macros
cbmachine ww;
mmachine mm;

Each plugin needs a function of loading and unloading. These functions are called by the Scol virtual machine, they have a signature set.

/*! 
 * \brief Starting point of the DLL
 */
 extern "C" __declspec (dllexport) 
 int ScolLoadPlugin(mmachine m, cbmachine w)
 {
       // Initializing SDK
     SCOLinitplugin(w);

     // Display debug message
     MMechostr(MSKDEBUG,"Loading Template DLL ...\n");    
     return 0; 
 }

 /*! 
 * \brief Ending point of the DLL                                            
 */
 extern "C" __declspec (dllexport)
 int ScolUnloadPlugin()
 {
     // Display debug messages
     MMechostr(MSKDEBUG, "Template DLL CLOSED...\n\n" );
     return 0;
 }

To add the plugin to the environment Scol must map the name of the functions of loading and unloading in the file "usm.ini"

plugin plugins/template.dll

Updated by arkeon over 9 years ago ยท 4 revisions