Delphi Plugin Framework - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Forum: Plug-Ins (/forumdisplay.php?fid=28) +------ Thread: Delphi Plugin Framework (/showthread.php?tid=21584) Delphi Plugin Framework by PsychoMark on 02-19-2004 at 03:34 PM
(sticky maybe?)
And what is missing:
The way it's implemented you must create a class descending from TMPPlugin and call RegisterPlugin in the DLL's entry point (the default begin-end you get when creating a DLL project). Override the Initialize function, register your commands (including tags or notifications) and the framework will take over from there, adding your commands to the Plus! plugins menu, calling your callback functions when a command is found. Need more processing? Override the various Execute methods to tap into the processing since all functions are declared as virtual! Didn't understand a word I was just saying? Not to worry, I've included a demo project showing a plugin with two commands, one tag and a notification. The advantage of this framework is you no longer have to copy and paste all the code to keep it C++-compatible, the framework takes care of that. No worrying about exports, pointers, correct calling conventions or returning strings longer than the Plus! buffers can handle... all taken care of Before I start to sound like a Tel-Sell comercial, I'll just attach the demo plugin, Plus! SDK conversion and framework. Hope it helps someone as much as it helps me Any feedback, bugs, fixes or Unicode implementations are of course appreciated, what else did I open-source it for eh? RE: Delphi Plugin Framework by PsychoMark on 02-19-2004 at 05:07 PM Updated the attachment with a newer version. One change in the code: fixed a bug with the menu leaving out the X and for tags even the (!...) part. The X is also no longer added automatically, so I updated the demo project as well to reflect that. The reason is simple: now you can just specify 'xdemo' as the command or tag, which turned out to be easier for the programmer because it resembles the actual command more... RE: Delphi Plugin Framework by tiojoca on 02-19-2004 at 06:07 PM
RE: Delphi Plugin Framework by PsychoMark on 02-22-2004 at 04:10 PM
I replaced the attachment above with a new version, implemented the following changes:
Filters I've seen several people struggling with the fact that Plus! plugins can't output tags like (!IP). Well, they can, but Plus! won't parse 'em so you just get (!IP) in the message instead of the actual IP address. Although this may change in future versions of Plus!, I added filters to the framework to solve it until then. A filter is basically a function which needs to be registered, and gets called whenever the plugin generates output (tags, commands, notifications). These filters may do whatever they like to the output, in the case of the supplied filters I'm using it to emulate the Plus! tags such as (!IP), (!N) and (!FCx). As far as I know all but three tags are supported: (!CN), (!VER) and (!WAT). WAT can be added quite easily, CN hasn't been added because I noticed Patchou scrambled the contact's email addresses (which is good for preventing abuse of course, but bad for me, now I can't read the custom names ). The filters included have been split into various units. The way they're designed all you have to do to include the filter is add it to your project, they will register themselves. This makes it easy to exclude tags you don't need... Because the Pos() function in Delphi is quite limited and StringReplace() is slow, I've used FastStrings for the filters. When you are not using the filters, it's not required to get FastStrings. If you do, FastStrings is easy to install, just dump the files in a directory and make sure that directory is in your library path (Tools -> Environment Options -> Library). The demo project has also been updated with a /xtags command to show the use of filters. RE: Delphi Plugin Framework by quietbritishjim on 05-22-2004 at 01:55 PM
Looks good. I've written quite a few trillian plugins in Delphi (see homepage) and I might just use this to create a couple for messenger plus Will it be updated when ver 3 comes out? RE: Delphi Plugin Framework by Whacko on 05-23-2004 at 12:23 PM
Looks nice RE: Delphi Plugin Framework by PsychoMark on 05-23-2004 at 07:03 PM
@quietbritishjim: yes, I will update it now Plus! 3 is out. Of course plugins are still compatible, with at least the Configure option added I know of... as for the rest, shouldn't take long to figure out, got Plus! 3 installed and loving it... RE: Delphi Plugin Framework by PsychoMark on 05-24-2004 at 11:25 AM
And here's the update for Plus! 3, thanks to Patchou keeping it all compatible it was easy...
Enjoy! Edit: attachment removed, instead I updated the attachment in the first post... |