www.sqledit.com
DTM SQL editor Online Documentation
General
Product profile
Product versions
Database tools
Install software
Upgrade software
Uninstall software
System requirements
How to buy
Product features
User interface
Hot keys
SQL editor
Search and replace
Data export
SQL library
Results viewer
Connect to database
Macros: definition and using
Database schema viewer
Find database object
Data editor
Schema object
Filter database schema
Version control
Command line options
Settings and options
SQL builder
SQL builder
Select type of the statement
Specity objects for select
Build WHERE cause
Select tables or views
Select one table or view
Select fields
Set or change values
ORDER BY and GROUP BY
Create table
Create index
Create view
Plug-ins and SDK
Plug-ins and SDK
Data structures
Plug-in sample, sources
Plug-ins Library
General information
Directory by DBMS
MS SQL Server
Run Query Analyzer
Oracle
Run SQL*Plus
General
Insert Module Header
External preprocessor
Run external tool
Run after script execution
Save/Load Hisroty
Send script by e-mail
Simply preprocessor
WinDiff interface
Directory by functions
Editor plug-ins
Insert Module Header
Run external tool
Run Oracle SQL*Plus
Run MS Query Analyzer
Send script by e-mail
Schema plug-ins
Results plug-ins
Common plug-ins
Run WinDiff
Save/Load Hisroty
Preporcessors
External preprocessor
Simply preprocessor
After execution plug-ins
Run after script execution
Information
Licence agreemnet
Technical support
Send feedback
FAQ and tips
Program tutorial
Troubleshooting guide
Glossary
SQL reference
SQL quick reference

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"