Dynamic link library for Symbian
2010-04-20 16:02:00 来源:WEB开发网//Dynamic link library for Symbian
//RMyLoadLibrary.h
///////////////////////////////////////////////////////
#ifndef __RMYLOADLIBRARY_H__
#define __RMYLOADLIBRARY_H__
///////////////////////////////////////////////////////
#include
///////////////////////////////////////////////////////
typedef void (*TFuncType_void_void)();
typedef TInt (*TFuncType_TInt_TInt)(TInt);
typedef TInt (*TFuncType_TInt_TAnyP)(TAny*);
typedef TAny* (*TFuncType_TAnyP_TInt)(TInt);
typedef TAny* (*TFuncType_TAnyP_TAnyP)(TAny*);
typedef TInt (*TFuncType_TInt_TDesP)(TDes*);
typedef TInt (*TFuncType_TInt_TDesP_TDesP)(TDes*,TDes*);
typedef TInt (*TFuncType_TInt_TDesP_TDesP_TDesP)(TDes*,TDes*,TDes*);
typedef TInt (*TFuncType_TInt_TDesP_TDesP_TDesP_TDesP)(TDes*,TDes*,TDes*,TDes*);
///////////////////////////////////////////////////////
class RMyLoadLibrary
{
public:
RMyLoadLibrary();
~RMyLoadLibrary();
public:
TInt LoadLibrary(const TDesC &aFileName,const TDesC &aPath);
void ReleaseLibrary();
public:
TLibraryFunction GetFunctionAdrr(TInt aFunctionIndex);
private:
RLibrary* iLibrary;
};
///////////////////////////////////////////////////////
#endif //__RMYLOADLIBRARY_H__
//RMyLoadLibrary.cpp
///////////////////////////////////////////////////////
#include “RMyLoadLibrary.h”
///////////////////////////////////////////////////////
RMyLoadLibrary::RMyLoadLibrary()
{
iLibrary = NULL;
}
RMyLoadLibrary::~RMyLoadLibrary()
{
ReleaseLibrary();
}
更多精彩
赞助商链接