An original extension of a function with a plug-in is provided in Metasequoia Ver2.0 or later. A plug-in is actually a DLL (Dynamic Link Library), and it is necessary to implement required functions for the propose.
A project for a plug-in must contain "MQInit.cpp". In the MQInit.cpp file, "MQCheckVersion" and "MQInit" functions are defined.
After loading a plug-in DLL from a main part of Metasequoia, a version of the plug-in is checked by MQCheckVersion function, and the plug-in will be disabled in case that the version is not supported.
When the version is supported, MQInit function is called. Addresses of all APIs are obtained through GetProcAddress() in this function. If the version of Metasequoia is old and some API functions have not been supported yet, MQInit() returns FALSE and the plug-in is disabled.
Metasequoia plug-in SDK provides some C++ classes such as MQDocument and MQObject. But, each class does not have implementations of own member functions or properties. It contains only inline functions that are thin wrappers to access the inside Metasequoia. This architecture enables a high compatibility for the future version, and it is not necessary for source codes or libraries except MQInit.cpp.
Do not create or destroy a class with 'new' operator or 'delete' operator. You must use the provided API functions.
This SDK contains MQBasePlugin.cpp/h. If you make a station/command plug-in with a normal API, it will be very troublesome because a message procedure between a plug-in and a main part of Metasequoia is complex. You can make the plug-in with a simple implementation by defining a new class inherited from MQBasePlugin/MQStationPlugin/MQCommandPlugin class and implementing required virtual functions.
MQStationPlugin class is defined for a station plug-in, and MQCommandPlugin class is defined for a command plug-in.