Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32std.h>
Link against: euser.lib

Class RLibrary

class RLibrary : public RHandleBase;

Description

A handle to a dynamically loadable DLL.

The class is not intended for user derivation.

Derivation

Members

Defined in RLibrary:

Inherited from RHandleBase:


Member functions


Close()

IMPORT_C void Close();

Description

Closes the DLL.

The function decrements the usage count by one.

This handle must have been used to load the DLL using one of the RLibrary::Load(const TDesC &,const TUidType &) functions.


Load(const TDesC &,const TUidType &)

IMPORT_C TInt Load(const TDesC &aFileName, const TUidType &aType);

Description

Loads the named DLL which matches the specified UID type.

If successful, the function increments the usage count by one. No additional search paths can be specified with this function.

Parameters

const TDesC16 &aFileName

A descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.

const TUidType &aType

A UID type (a triplet of UIDs) which the DLL must match. Individual UIDs can contain the KNullUid wild card.

Return value

TInt

KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.


Load(const TDesC &,const TDesC &)

IMPORT_C TInt Load(const TDesC &aFileName, const TDesC &aPath=KNullDesC);

Description

Loads the named DLL.

If successful, the function increments the usage count by one.

Parameters

const TDesC16 &aFileName

A descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.

const TDesC16 &aPath

A descriptor containing a list of path names, each separated by a semicolon. When specified, these paths are searched for the DLL before the standard search locations. By default, no pathnames are specified.

Return value

TInt

KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.


Load(const TDesC &,const TDesC &,const TUidType &)

IMPORT_C TInt Load(const TDesC &aFileName, const TDesC &aPath, const TUidType &aType);

Description

Loads the named DLL that matches the specified UID type.

If successful, the function increments the usage count by one.

Parameters

const TDesC16 &aFileName

A descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.

const TDesC16 &aPath

A descriptor containing a list of path names, each separated by a semicolon. When specified, these paths are searched for the DLL before the standard search locations.

const TUidType &aType

A UID type (a triplet of UIDs) that the DLL must match. Individual UIDs can contain the KNullUid wild card.

Return value

TInt

KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.


Load(const TDesC &,const TDesC &,const TUidType &,TUint32)

IMPORT_C TInt Load(const TDesC &aFileName, const TDesC &aPath, const TUidType &aType, TUint32 aModuleVersion);

Description

Loads the named DLL that matches the specified UID type and version.

If successful, the function increments the usage count by one.

Parameters

const TDesC16 &aFileName

A descriptor containing the name of the DLL to be loaded. The length of the file name must not be greater than KMaxFileName.

const TDesC16 &aPath

A descriptor containing a list of path names, each separated by a semicolon. When specified, these paths are searched for the DLL before the standard search locations.

const TUidType &aType

A UID type (a triplet of UIDs) that the DLL must match. Individual UIDs can contain the KNullUid wild card.

TUint32 aModuleVersion

A version specification that the DLL must match. Major version must match exactly and minor version must be >= the specified minor version.

Return value

TInt

KErrNone, if successful; KErrBadName, if the length of aFileName is greater than KMaxFileName; otherwise one of the other system wide error codes.


Lookup(TInt)const

IMPORT_C TLibraryFunction Lookup(TInt anOrdinal) const;

Description

Gets a pointer to the function at the specified ordinal within this DLL.

Parameters

TInt anOrdinal

The ordinal of the required function in this DLL. This value must be positive.

Return value

TLibraryFunction

A pointer to the function at position anOrdinal in this DLL. The value is NULL if there is no function at that ordinal.

Panic codes

USER

116 if anOrdinal is negative


Type()const

IMPORT_C TUidType Type() const;

Description

Gets this DLL's UID type.

The UID type is a property of a Symbian OS file; for a DLL, its value is set during the building of that DLL.

Return value

TUidType

The UID type of this DLL. Note that the first TUid component of the TUidType has the value KDynamicLibraryUid.


FileName()const

IMPORT_C TFileName FileName() const;

Description

Gets the name of the DLL's file.

Return value

TBuf

The DLL's filname.


GetRamSizes(TInt &,TInt &)

IMPORT_C TInt GetRamSizes(TInt &aCodeSize, TInt &aConstDataSize);

Description

Gets the current size of the code and the const data for this DLL.

This function can be called on a RAM loaded DLL or a ROM based DLL.

Parameters

TInt &aCodeSize

The current size of the code for a RAM loaded DLL. This is zero for a ROM based DLL.

TInt &aConstDataSize

The current size of the const data for a RAM loaded DLL. This is zero for a ROM based DLL.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.