Sometimes, attempts by clients to instantiate a plug-in leave with a generic error code of -46 or -1. This page discusses the most likely reasons why this might happen.
Error -46 (KErrPermissionDenied
):
This error relates to platform security. If Platform Security diagnostic messages are enabled, ECom logs such errors to the system message log. For details of using this log, see Debug output (system message log) from the emulator.
Possible causes of the error are:
The plug-in DLL providing the implementation has less platform security capabilities than the client process. This is a problem as the platform security DLL loading rules require a DLL to have the same or greater capabilities as the process trying to use it.
See 3.2.3 Assigning capabilities to a process of Symbian OS v9 Security Architecture in the Platform security section for more information on assigning capabilities to processes and DLLs.
The plug-in DLL providing the implementation was incorrectly installed on a media card. The system hash value of the plug-in DLL was missing, or it was inconsistent with the one calculated for the plug-in DLL at load time.
See 3.4.2 Removable media of Symbian OS v9 Security Architecture in the Platform security section for more information on software installation on removable media.
There was an error in how the plug-in was written: the UID value
given in the dll_uid
member of the REGISTRY_INFO
structure in the plug-in's resource
file did not match the Secure ID (UID3 value) of the plug-in DLL. If ECom finds
that these values do not match, ECom discards the plug-in and does not add it
to its registry of available plug-ins.
Plug-in writers should see How to provide registry information for
information on the REGISTRY_INFO
structure.
Error -1 (KErrNotFound
):
This indicates an error in coding or installing the plug-in. The problem needs to be fixed by the creator of the plug-in.
Possible causes of the error are:
When porting a plug-in from a version of Symbian OS before 9.1, the files were not installed in the locations required by Symbian OS v9.1 and later versions. This prevents ECom from discovering the plug-in.
See How to write an implementation collection's project file for details of how to write a project file that puts the files in the correct locations.
The plug-in was compiled using the CodeWarrior IDE before version
3.1. This ignores the TARGET
keyword in START
RESOURCE
...END
blocks, so that the wrong resource file is
built. For example, in this project:
START RESOURCE 123456789.rss
TARGET foo.rsc
END
the resource file built is 123456789.rsc
rather than
the expected foo.rsc
.
Solutions are to build from the command line or from a later version of CodeWarrior.
DLLs to which the plug-in links are absent from the phone.
The eshell text shell provides these commands to help you check for missing DLLs:
chkdeps
checks the dependencies of an
executable.
trace /L
in debug builds outputs messages
describing why an attempt to load a DLL fails.
The TImplementationProxy
array coding does
not contain a matching entry for the plug-in.
See How to export the implementation factories for more information on TImplementationProxy
.