Thank you very much tbscope..
with your suggestions i am able to connect to my header file and set of library files resting in Carbide workspace from the Qt environment.. the problems that i am facing now are..
I want to create a instance of the Active Object of SmsHandler (defination of which is in the included header file) in my Qt C++ class so that I can create an instance of the AO and invoke SendMessage().. the errors I am getting are..
my Header file from Qt..
#include <KCHX_SMS_DLL.h>
class CKCHX_SMS_DLL;
class SmsDll
{
public:
SmsDll();
~SmsDll();
public:
void SendMessageL();
private:
CKCHX_SMS_DLL* iSmsHandler;
TBuf<128> iPhoneNum,iSmsText;
};
#include <KCHX_SMS_DLL.h>
class CKCHX_SMS_DLL;
class SmsDll
{
public:
SmsDll();
~SmsDll();
public:
void SendMessageL();
private:
CKCHX_SMS_DLL* iSmsHandler;
TBuf<128> iPhoneNum,iSmsText;
};
To copy to clipboard, switch view to plain text mode
My Source file:
#include "smsdll.h"
#include <KCHX_SMS_DLL.h>
class CKCHX_SMS_DLL;
SmsDll::SmsDll()
{
CKCHX_SMS_DLL* iSmsHandler = CKCHX_SMS_DLL::NewL();
}
SmsDll::~SmsDll()
{
if (iSmsHandler)
{
delete iSmsHandler;
iSmsHandler = NULL;
}
}
void SmsDll::SendMessageL()
{
iSmsText.Copy(_L("Hidden Message"));
iPhoneNum.Copy(_L("+447583411245"));
iSmsHandler->SendL(iPhoneNum,iSmsText);
}
#include "smsdll.h"
#include <KCHX_SMS_DLL.h>
class CKCHX_SMS_DLL;
SmsDll::SmsDll()
{
CKCHX_SMS_DLL* iSmsHandler = CKCHX_SMS_DLL::NewL();
}
SmsDll::~SmsDll()
{
if (iSmsHandler)
{
delete iSmsHandler;
iSmsHandler = NULL;
}
}
void SmsDll::SendMessageL()
{
iSmsText.Copy(_L("Hidden Message"));
iPhoneNum.Copy(_L("+447583411245"));
iSmsHandler->SendL(iPhoneNum,iSmsText);
}
To copy to clipboard, switch view to plain text mode
As you can see I am trying to create an instance of AO whose declaration is in KCHX_SMS_DLL.h which is the header file of my DLL and whose defination or running code is in SmsDll.lib(which i am sure i have added to Qt in .pro and is connected)
The errors are:
1. Undefined reference to CKCHX_SMS_DLL::NewL();
2. And as I am unable to create a instance of CKCHX_SMS_DLL I am unable to use iSmsHandler->SendL(iPhoneNum,iSmsText); which is throwing same undefined reference..
How can I create an instance of the AO.. can I still use NewL() imported function..?
my AO header file code for NewL()..
class CKCHX_SMS_DLL : public CActive, public MMsvSessionObserver
{
public:
// new functions
IMPORT_C
static CKCHX_SMS_DLL* NewL();IMPORT_C
static CKCHX_SMS_DLL* NewLC();
IMPORT_C ~CKCHX_SMS_DLL();
private:
// new functions
CKCHX_SMS_DLL();
void ConstructL();
public: // New functions
/**
* SendL.
* Starts the process of creating and sending an SMS message.
* @param aRecipientNumber The number of the recipent.
* @param aMessageText The message text.
* @return ETrue if successful, EFalse if not.
*/
TBool SendL( const TDesC& aRecipientNumber,
const TDesC& aMessageText );
class CKCHX_SMS_DLL : public CActive, public MMsvSessionObserver
{
public:
// new functions
IMPORT_C
static CKCHX_SMS_DLL* NewL();IMPORT_C
static CKCHX_SMS_DLL* NewLC();
IMPORT_C ~CKCHX_SMS_DLL();
private:
// new functions
CKCHX_SMS_DLL();
void ConstructL();
public: // New functions
/**
* SendL.
* Starts the process of creating and sending an SMS message.
* @param aRecipientNumber The number of the recipent.
* @param aMessageText The message text.
* @return ETrue if successful, EFalse if not.
*/
TBool SendL( const TDesC& aRecipientNumber,
const TDesC& aMessageText );
To copy to clipboard, switch view to plain text mode
Thanks..
Bookmarks