how to use a static dll

Login to reply to this topic.
Thu, 2005-08-18 09:20
Joined: 2005-02-15
Forum posts: 21
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

Thu, 2005-08-18 09:30
Joined: 2005-07-25
Forum posts: 19
Re: how to use a static dll
Did you install your dll into system/libs on the phone?
Sun, 2005-08-21 00:30
Joined: 2004-06-06
Forum posts: 205
Re: how to use a static dll
Quote
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 )
you need to install dll on device. on app dir or system\libs

Best regards,
Michal Laskowski

  • Login to reply to this topic.