Table of Content
Plug-ins and SDK

Adding plug-ins to the current version of DTM SQL editor helps users to extend the functionality of the program. It is also a possibility for the third party developers wishing to make additions to the program.

There are some plug-ins in the program distribution and You always can order or download for free more of them on the www.sqledit.com web site. All new extensions will be placed there.

We can help You in distribution of your new useful plug-in. Contact us when You will have it written - we'll discuss a distribution policy: plugins@sqledit.com.

How to build plug-in

Plug-Ins are common Win32 DLLs, placed in the same folder as the program and exporting at least two functions (see sample DEF-file in SDK):

  • int WINAPI OnInstall(PL_DATA *data, ED_DATA *data2);
  • void WINAPI OnCall();

and two optional functions (see sample DEF-file in SDK):

  • void WINAPI OnExit();
  • void WINAPI OnSettings();

The first function gets called once when plug-in is initialized, the second - any time the plug-in’s functionality is required, and the third - when plug-in is unloaded or the program is stopped. OnSettings (if present) function called from "Settings" submenu of "Plug-ins" DTM SQL editor menu.

When something gone wrong during the plug-in’s installation the OnInstall function should return a nonzero result which is meant to be an error code. Current version of the editor doesn’t do any special processing of the error codes.

The data argument points to the structure filled with the plug-in’s data, data2 points to the memory location where the editor can store some info about itself.

The "OnInstall", "OnCall",  "OnExit" and "OnSettings" functions have to be extern "C".

Plug-in types

  • PT_TEXT - Plug-In adds item for the EDITOR-page context menu.
  • PT_RESULTS - Plug-In adds item for the RESULTS-page context menu.
  • PT_MENU - adds item to main program menu after the last available item.
  • PT_SCHEMA - adds item for the SCHEMA-page context menu.
  • PT_PREPROCESSOR - plug-in called before any script execution
  • PT_AFTER_EXEC - plug-in runs automatically after any successful script execution.

Warning!: This version of the editor assumes all pointers to be static and constant. Any attempt to alter these pointers can lead to unpredictable results.

Warning! You can have only one PT_PREPROCESSOR plug-in installed simultaneously.

See also: "Data structures", "Simple plug-in"