×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    26

    A Data abort exception has occured

    Hi All..

    I am trying to create an instance of a Symbian AO from inside a Qt C++ class..

    Code:
    SendSms::SendSms()
    {
    iSmsDll->NewL();
     
    }

    and in the destructor.. i am not sure how to delete or whether not to delete the instance of the Symbian Instance..
    Code:
    SendSms::~SendSms()
    {
    delete iSmsDll;
    //    if (iSmsDll)
    //    {
    //     delete iSmsDll;
    //     iSmsDll = NULL;
    //    }
     
    }

    My aim is to pass a Phone Number and some Text Message to a SendL() function of the Symbian Active Object which is actually a DLL loaded in to my Qt app.. from within a function of my Qt C++ class..
    Code:
    bool SendSms::SendSmsDll()
    {
        //char  *iPhoneNum= "+447583411245", *iSmsText = "Hidden Message";
        //iSmsText("Hidden Message");
        //iPhoneNum.Copy(_L("+447583411245"));
        TBuf16<128> iPhoneNum,iSmsText;
        iSmsText.Copy(_L16("Hidden Message")); iPhoneNum.Copy(_L16("+447908786655"));
        TBool retval = iSmsDll->SendL(iPhoneNum,iSmsText);
        if(retval)
        {
            return false;
        }
        else
        {
            return true;
        }
     
    }
    My Symbian AO's SendL() prototype:
    Code:
    TBool SendL( const TDesC& aRecipientNumber,const TDesC& aMessageText );

    My problem is I am getting "A Data exception has occured" exception when I trigger this SendSmsDll().. is this related to creating and deleting of Symbian AO from within Qt..???

    and if don create an instance of the AO and don delete it's instance n use SendL() directly I am getting "Thread 0x1f1 has panicked. Category: USER; Reason: 11" error.. i guess something related to copying data in to descriptors..

    Can u plz help me how to resolve these two erros..

    Thanks..

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: A Data abort exception has occured

    Can you give focus on this iSmsText? How you are declaring this descriptor?

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    26

    Re: A Data abort exception has occured

    Thanks for the reply mahbub_s60..

    I have declared both iSmsText and iPhoneNumber in SendSmsDll() as local varibales.. TBuf16<128> iPhoneNum,iSmsText;
    bool SendSms::SendSmsDll()
    {

    TBuf16<128> iPhoneNum,iSmsText;

    iSmsText.Copy(_L16("Hidden Message")); iPhoneNum.Copy(_L16("+447908786655"));

    TBool retval = iSmsDll->SendL(iPhoneNum,iSmsText);

    if(retval)
    {
    return false;
    }
    else
    {
    return true;
    }

    }
    Thanks..

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: A Data abort exception has occured

    You can try to make these 2 as member variable
    iPhoneNum,iSmsText

    I guess those goes out of scope when the function returns.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    26

    Re: A Data abort exception has occured

    Quote Originally Posted by newbis60 View Post
    Hi All..

    I am trying to create an instance of a Symbian AO from inside a Qt C++ class..

    Code:
    SendSms::SendSms()
    {
    iSmsDll->NewL();
     
    }

    that doesnt seem correct. may be you need to do this:

    iSmsDll = YourSMSDLLClass::NewL();

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: A Data abort exception has occured

    Quote Originally Posted by digitalsurgeon View Post
    that doesnt seem correct. may be you need to do this:

    iSmsDll = YourSMSDLLClass::NewL();
    Good point digitalsurgeon. But that should have a crash?

  7. #7
    Registered User
    Join Date
    Sep 2010
    Posts
    26

    Re: A Data abort exception has occured

    Thank you soo much guys..

    I have solved my problem.. i think the problem was creating the instance of iSmsDll.. as every one suggested..(i actually thought its a Symbian problem and I started another post in Symbian programming forum..in case intrested u can check http://discussion.forum.nokia.com/fo...on-has-occured)

    I have changed my code like this and its working fine now.. Thanks mahbub_s60 and digitalsurgeon for you suggestions on creating the instance and use of function parameters..

    #include "TestQt.h"
    #include <myDll.h>

    TestQt::TestQt(QWidget *parent)
    : QMainWindow(parent)
    {
    ui.setupUi(this);
    iSmsDll = SMS_DLL::NewL();
    iSmsText.Copy(_L("SMS Message"));
    iPhoneNum.Copy(_L("+44411245"));

    }

    TestQt::~TestQt()
    {
    delete iSmsDll;
    }
    void TestQt:n_sendSmsButton_clicked()
    {
    iSmsDll->SendL(iPhoneNum,iSmsText);
    }

Similar Threads

  1. data abort exception accessing CCDOutgoingGprsRecord::iGPRSAPType
    By pavarang in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2010-10-13, 10:33
  2. Suspended: Signal 'Exception 0' received. Description: A data abort exception occured
    By amit04.kumar in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2010-10-12, 12:57
  3. Replies: 6
    Last Post: 2010-06-16, 09:21
  4. Replies: 4
    Last Post: 2009-12-11, 09:43
  5. Replies: 3
    Last Post: 2008-09-30, 16:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×