I want to load a DLL from the data directory (i.e. '\private\<app_id>\'). The DLL is extracted from a data file, written to the data dir using a random filename, and loaded by the application.
Below is the code that loads the DLL.
RLibrary::Load always returns -1. The paths are correct so it seems that for some reason the system refuses to load the library.
Any idea why that is and how I can make it work?
Just to clarify that the DLL has to be extracted at run-time. It cannot be installed.
Thank you in advance,
nkString::CStringW csPathName = szPathName;
const int nSplitFineName = csPathName.ReverseFind(*PATH_SPERATOR);
if (nSplitFineName < 0)
nkString::CStringW csPath = csPathName.Left(nSplitFineName);
nkString::CStringW csFileName = csPathName.Right(csPathName.GetLength() - (nSplitFineName + 1));
TPtrC16 cPath((const TUint16*)LPCWSTR(csPath));
TPtrC16 cFileName((const TUint16*)LPCWSTR(csFileName));
RLibrary* pLibrary = new RLibrary();
TInt nError = pLibrary->Load(cPath,cFileName);
if (nError != KErrNone)