Plugin development

huwks

Member
Good afternoon everyone !
Where can I find material for PL / SQL plugin development?

I try to write plugin in Delphi 10.2
I took an example from PlugInDoc\Delphi\Demo1
Compile and build it without any errors. Then add a dll file to PLSQL Developer 12\PlugIns folder.

My developer version is 12.0.7.1837 (32 bit). I don`t see my plugin into the menu items(Plug-Ins or Tools), but I see it in plugin configuration. But it is too strange.Only first character from
plugin name and first character from plugin info. Pleas tell me what I am doing wrong ?

Thank you !
 
Note that strings values are passed as AnsiString / PAnsiChar. If you use the standard String data type in Delphi 10.2 you will be using double-byte characters, so the zero-bytes will cause truncation.

We'll correct the demos for newer Delphi versions!
 
Thank you for your reply.
Could you please give me the code sample ?
In demo example it was
function IdentifyPlugIn(ID: Integer): PChar; cdecl;
begin
PlugInID := ID;
Result := Desc;
end;

// Creating a menu item
function CreateMenuItem(Index: Integer): PChar; cdecl;
begin
Result := '';
case Index of
1 : Result := 'Tools / &Plug-In 1 Demo...';
end;
end;

I change it to --- function IdentifyPlugIn(ID: Integer): String; cdecl;

and

function CreateMenuItem(Index: Integer): String; cdecl;

now I have access violation error in Developer - in plug-ins menu then click on plugin info button. I see demo-plugin in configuration (plug-in manager) - all characters in name. But not in plug-ins menu.
 
In Dephi 10.2 you need to change PChar to PAnsiChar:

function IdentifyPlugIn(ID: Integer): PAnsiChar; cdecl;
...

function CreateMenuItem(Index: Integer): PAnsiChar; cdecl;
...
 
Back
Top