×

Discussion Board

Results 1 to 12 of 12

Thread: SMS question.

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    165

    SMS question.

    Hi to all,

    I am using the code of Kiran -> SmsHandler.
    Now, I succeed to send SMS message.

    The question is if every time that I send sms I need to Open new MTM???
    I mean.. in the source code there is
    HandleSessionEventL
    case: EMsvServerReady
    ...
    AccessMTM();
    SendMsg()

    Do I need to Initialize like that :
    Code:
    	CSmsHandler* iSmsHandler = CSmsHandler::NewL();
    every time when I send SMS message ?

    I am using console application(EXE)

    Usage For example:
    every time that press '5' key it will send SMS.

    Any help ????

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: SMS question.

    Well from the code it looks to me that since it is a member variable it is initialized only once during the creation of that object, but since I have not seen the complete code I am not sure if that object is created locally everytime.My understanding says it should be done only once you your application is launched and it should work fine after that.
    Maximus
    S60 Developer
    Impossible is nothing

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: SMS question.

    hi,

    It should not be a problem you need to declare you iSmsHandler as the memeber variable of the class create it once in the ConstructL of your class, and implement the key capture code as given in this wiki link for the key 5. You should be able to send sms for every key press of 5.
    Regards,
    Sriky

  4. #4
    Registered User
    Join Date
    Aug 2007
    Posts
    165

    Re: SMS question.

    Hi,
    Thanks for the reply.

    I did what you advice to me
    I have insert the
    Code:
    CSmsHandler* iSmsHandler = CSmsHandler::NewL();
    to the constructor of my class.

    But the problem is when I calling the function CreateMsgL()
    the my program stak on that line:
    Code:
        iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
    The error:
    Code:
    Suspended: Signal 'Exception 0' received. Description: A data abort exception has occurred..
    What sould I do ???

  5. #5
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: SMS question.

    Hi,
    From where are you calling this function CreateMsgL()? Can you show the code snippet for it.
    Maximus
    S60 Developer
    Impossible is nothing

  6. #6
    Registered User
    Join Date
    Aug 2007
    Posts
    165

    Re: SMS question.

    That was quick ...

    I am calling from other class..

    little snippet from my code:
    Code:
    CImplementor::~CImplementor()
    {
    }
    
    CImplementor::CImplementor()
    {
    CSmsHandler* iSmsHandler = CSmsHandler::NewL();
    }
    
    // This is an implementation of pure virtual fucntion from MDirObserver
    
    void CImplementor::CChange()
                    {
        iSmsHandler->SendMsg();
        		}
    	
    }
    BTW this snippet derived from MDirObserver it's to check if there is any change in file on directory (It's only for testing...)

    thanks...
    Last edited by Dvirus; 2008-10-28 at 14:37. Reason: sytanx err

  7. #7
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: SMS question.

    Quote Originally Posted by Dvirus View Post
    Hi,
    Thanks for the reply.

    I did what you advice to me
    I have insert the
    Code:
    CSmsHandler* iSmsHandler = CSmsHandler::NewL();
    to the constructor of my class.

    But the problem is when I calling the function CreateMsgL()
    the my program stak on that line:
    Code:
        iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
    The error:
    Code:
    Suspended: Signal 'Exception 0' received. Description: A data abort exception has occurred..
    What sould I do ???
    Hi,

    Declaring it has
    CSmsHandler* iSmsHandler = CSmsHandler::NewL();
    makes it a automatic variable it loses scope once it is out the api.

    You should declare it in the header sth lie

    private:
    CSmsHandler* iSmsHandler;

    and in the ConstructL

    iSmsHandler = CSmsHandler::NewL();
    Regards,
    Sriky

  8. #8
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: SMS question.

    Hi,
    You mentioned the error is coming in code from CreateMsgL() function. I could not understand the flow as to how SendMsg() is related (it may be your implementation requirement)with this.Are you not able to send even a single message or is it happening if you try to send multiple messages.
    Maximus
    S60 Developer
    Impossible is nothing

  9. #9
    Registered User
    Join Date
    Aug 2007
    Posts
    165

    Re: SMS question.

    Thanks A lot Sriky and yogpan!!!!

    Problem Solved!!!

    Keep helping people...




    Regards,
    Dvir.

  10. #10
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: SMS question.

    So what was the problem. Was it only the declaration part or was it something else which you figured out later
    Maximus
    S60 Developer
    Impossible is nothing

  11. #11
    Registered User
    Join Date
    Aug 2007
    Posts
    165

    Re: SMS question.

    bad declaration ;(
    I am always falling in that part... this is suppose to be the easy thing.
    probably it doesn't...

    But don't worry the 'little story' didn't end.. I still need to check some things....

    Thanks again!! and have a nice day...



    Dvir.

  12. #12
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: SMS question.

    Hi,
    That is the practical problem which many people face. But its always good to know better coding practices for the platform in which one is working.
    If not gone through you can have a look into this document on coding practices in Symbian this will definitely save lot of your efforts
    http://www.forum.nokia.com/info/sw.n..._0_en.pdf.html

    All the best with Symbian programming
    Maximus
    S60 Developer
    Impossible is nothing

Similar Threads

  1. Question about phonebook, sms, mms,email
    By zhangwei_Nirvana in forum Symbian
    Replies: 6
    Last Post: 2008-06-07, 06:53
  2. Question: There is no "Reply" option after creating SMS in Inbox
    By squander in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2007-11-23, 07:05
  3. Specific URL in SMS Question
    By mobilrelay in forum General Messaging
    Replies: 0
    Last Post: 2005-02-14, 17:29
  4. Question about SMS support!!!
    By Ahjin in forum Mobile Java General
    Replies: 2
    Last Post: 2003-05-09, 14:44
  5. My SMS question deleted!!!
    By adayuen in forum General Messaging
    Replies: 1
    Last Post: 2002-09-26, 12:35

Posting Permissions

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