[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] [ Search: ]

4.3.1.5 Interface Versions

Unlike COM, SCF supports interface versions. That is, a shared class could implement version 0.3.6 of given interface, and if client requests that interface of a version lower or equal than 0.3.6, a correct interface pointer is returned. For this to work you need to define inside each interface header file a specialization of the scfInterface<> template class for each interface. This specialization must provide the interface's version number as the result of its GetVersion() method. To correctly support different versions of interfaces you should follow these guidelines:

The possible range for major and minor version numbers is 0..255, and the range for micro version number is 0..65535.

When you query an interface, you should always tell it what interface version are you looking for. If a module cannot provide an interface compatible with the requested version, then QueryInterface() will return ‘NULL’ (same as if interface wasn't available at all). You can use scfCompatibleVersion() to check whether the requested version is compatible with interface version. To specify the version of an interface you can use the SCF_INTERFACE() macro.


This document was generated using texi2html 1.76.