KeePass

KeePass
Password Safe








Get KeePass

Get Another Backup Plugin for KeePass at SourceForge.net. Fast, secure and Free Open Source software downloads

Plugin Framework for KeePass

Copyright © 2009 Bill Rubin

Distributed under the Boost Software License

When KeePass (Classic Edition) introduced its COM interface to plugins in Version 1.15, I developed the Plugin Framework for KeePass (PFK) in order to more easily convert Another Backup Plugin to this new interface. Other developers of existing KeePass (Classic Edition) plugins may find PFK useful for the same purpose. Developers of new KeePass Classic Edition plugins should also find PFK useful. In my view, every plugin for KeePass 1.15 or later would benefit by using PFK.

PFK Features

Plugin Framework for KeePass (PFK) is a Visual Studio 2005 C++ project useful for developing plugins for KeePass Version 1.15 or later. With PFK, the KeePass plugin developer need not write or maintain large amounts of boilerplate code to interface the plugin with Keepass, or to perform common plugin operations. With PFK, the plugin developer can focus on the application code specific to the plugin. PFK features include:

  1. Complete implementation of the IID_IKpUnknown interface.
  2. Implementation of the IID_IKpPlugin interface, except for the OnMessage member function, which is always application-specific.
  3. Ability to get smart pointers to any other KeePass interface, including IKpAPI, IKPCommandLine, IKpCommandLineOption, IKpConfig, IKpDatabase, IKpFileTransaction, IKpFullPathName, and IKpUtilities.
  4. Implementation of the KpCreateInstance function, which the plugin must export from its DLL.
  5. Comprehensive error checking of COM handshaking for Items 3 and 4. If an error is found, PFK displays a message box containing all information about the error. Without this feature, a plugin will, in most cases, silently fail to load. In other cases, it will fail to perform its function.
  6. Convenience utilities to display a message box, translate a Windows error code into a natural language string, and declare a standard string independently of character type.
  7. Compile-time checking of constructor invocations for smart COM pointers. Without this feature, it is difficult for a developer to interpret compiler error messages caused by using the wrong smart COM pointer constructor.
  8. The PFK code avoids defining macros. Instead templates, inline functions, typedefs, and other C++ constructs maintain safe design practices, with no runtime penalty.

PFK Downloads

The following table shows the correspondences between KeePass Classic Edition versions and PFK versions.


KeePass Version
Plugin Framework for KeePass
   Version    Source Code
1.17 or later 1.2 PFK1.2.zip
1.16 or later 1.1 PFK1.1.zip
1.15 or later 1.0 PFK1.0.zip
1.14 or earlier none

PFK Installation Instructions

  1. Download the PFK zip file from the above table.
  2. Unzip the downloaded file into a PluginFramework directory under the KeePass Plugins directory.
  3. Add the PluginFramework Visual Studio project to the KeePass solution.
  4. Build the PluginFramework project. The output is a static library.
  5. To make PFK accessible to your plugin project, add PluginFramework as a reference in the common properties of your plugin project.

Using PFK

To integrate PFK into your existing or new plugin, it is highly recommended to look at the source code of TestPluginPFK, Another Backup Plugin, or other plugins which already use PFK.

PFK Version History

Version 1.2 for KeePass 1.17 or later (4Dec2009)

  1. Adds support for FileTransaction Interface.

Version 1.1 for KeePass 1.16 or later (4Jun2009)

  1. Uses IKpAPI2 interface instead of IKpAPI.

Version 1.0 for KeePass 1.15 or later (31Jan2009)

Initial release.