A polymorphic DLL is loaded by calling one of the Load()
member functions of an RLibrary
object.
Load()
has three overloaded variants but they all behave in a similar way. They are prototyped:
TInt Load(const TDesC& aFileName,const TDesC& aPath,const TUidType& aType);
TInt Load(const TDesC& aFileName,const TUidType& aType);
TInt Load(const TDesC& aFileName,const TDesC& aPath=_L(""));
The arguments determine how the DLL is to be found. The rules are summarised as follows:
If aFileName
is a fully defined filename, i.e it includes a path specification, then the content of aPath
is ignored and an attempt is made to load aFileName
, if specified; if this DLL cannot be found, then the load operation fails and no further searching is done.
if aFileName
does not have an extension, an extension of .DLL
is assumed.
If aFileName
contains a file name but does not include a path specification (e.g. _L("EULIBDR1.DLL
"), then a search is done in the following locations in the order given:
the path defined in aPath
, if specified
the system path \system\libs\
on each attached drive. Drives are searched in the order: C:
(the RAM drive), A:
, B:
, D:
, E:
, F:
,...Y:
and finally, drive Z:
(the ROM).
If aType
is specified, then the UIDType of the loaded DLL must match aType
. If aType
is KNullUid
, or the variant of Load()
that does not take aType
is called, then the loaded DLL will have the name aFileName
and may have any UIDType.
Note that in WINS debug mode, the system path is \epoc32\release\wins\udeb\
on the current PC drive; in WINS release mode, the system path is \epoc32\release\wins\urel\
on the current PC drive.
Note also that, in contrast with the usual convention, aPath
specifies a list of directories, each one separated by a semicolon.
See also: