|
|
User login
Feeds |
how to use a static dll
|
|||||
| Thu, 2005-08-18 09:20 | |
|
Hi all
I have a static interface DLL , But not able to figure out how to use it on Target. Lets say the Dll name is CreateStaticDLL.dll which has an exported function fromdll() In HelloworldAppUi.cpp I have included my dll's header file i.e., CreateStaticDLL.h and used the function fromdll()(which was exported in CreateStaticDLL.dll). And in Helloworld.mmp file i have added the line . LIBRARY CreateStaticDLL.lib Finally after compiling ,installing and running helloworld application on target .it pops a message NOT FOUND I have installed only helloworld.sis file apart from this should i install any other files (like .dll or .lib if so in which path i should install on target ) Can anyone hyelp me out please or point to a good documentation which explains the dll usage . ----------------------------------------------------------------------------------------------------- CreateStaticDLL.cpp ------------------------------------------------------------------------------------------------------ #include "CreateStaticDLL.h" #include <e32uid.h> EXPORT_C CMessenger* CMessenger::NewLC( const TDesC& aString) { CMessenger* self=new (ELeave) CMessenger(); CleanupStack::PushL(self); self->ConstructL(aString); return self; } CMessenger::~CMessenger() // destruct - virtual, so no export { delete iString; } EXPORT_C void CMessenger::ShowMessage() { _LIT(KFormat1,"%S\n"); } CMessenger::CMessenger() { } void CMessenger::ConstructL(const TDesC& aString) { iString=aString.AllocL(); } EXPORT_C TInt CMessenger::fromdll() { return 100; } GLDEF_C TInt E32Dll(TDllReason) { return(KErrNone); } ------------------------------------------------------------------------------------------------------------ CreateStaticDLL.h ----------------------------------------------------------------------------------------------------------- #include <e32base.h> #include <e32def.h> #include <e32std.h> class CMessenger : public CBase { public: IMPORT_C static CMessenger* NewLC( const TDesC& aString); ~CMessenger(); IMPORT_C void ShowMessage(); IMPORT_C TInt fromdll(); private: CMessenger(); void ConstructL(const TDesC& aString); // second-phase constructor private: HBufC* iString; // Allocated container for string data (destructor destroys) }; ---------------------------------------------------------------------------------------------------------------------------------- CreateStaticDLL.mmp ---------------------------------------------------------------------------------------------------------------------------------- TARGETTYPE dll UID 0x1000008d 0x01004268 SOURCEPATH . SOURCE CreateStaticDLL.cpp USERINCLUDE . SYSTEMINCLUDE \Epoc32\include LIBRARY euser.lib deffile .\CREATESTATICDLL_ARMI_UDEB.def nostrictdef ----------------------------------------------------------------------------------------------------------------------------- Software used: M1000 SDK HARDWARE used: M1000 phone Thanking You all, Reddy |
|
Forum posts: 19
Forum posts: 205
Best regards,
Michal Laskowski