×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Unhappy make new sms in inbox

    hi

    I am using the following code to create an SMS in inbox,

    the application crashes when I choose the option. please guide me.


    The enum case is

    case EHelloWorldSelectMe:
    TBool iSendingSms=ETrue;
    TBuf<10> aAddress(_L("Nokia"));
    TBuf<20> aDescription(_L("Important Message"));

    _LIT(KTxt1,"Hi phone owner, how r u?");

    TBuf<150> iMessage;
    iMessage.Copy(KTxt1);

    iMtmRegistry = CClientMtmRegistry::NewL(*iSession);
    iSmsMtm = STATIC_CAST( CSmsClientMtm*, iMtmRegistry->NewMtmL(KUidMsgTypeSMS));

    iSmsMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId); //inbox

    iSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid);

    CSmsHeader& iHeader = iSmsMtm->SmsHeader();
    iHeader.SetFromAddressL(aAddress);


    CRichText& body = iSmsMtm->Body();
    body.Reset();
    body.InsertL(0, iMessage);

    TMsvEntry entry = iSmsMtm->Entry().Entry();
    entry.SetInPreparation(EFalse);
    entry.SetVisible(ETrue);
    entry.iDate.HomeTime();
    entry.iDescription.Set(aDescription);
    entry.iDetails.Set(aAddress);
    entry.SetUnread(ETrue);


    iSmsMtm->Entry().ChangeL(entry);
    iSmsMtm->SaveMessageL();

    //iEikonEnv->InfoWinL(R_HELLOWORLD_TITLE, R_HELLOWORLD_DESCRIPTION);
    break;

    and header file is

    #ifndef HELLOWORLDAPPUI_H
    #define HELLOWORLDAPPUI_H

    #ifdef __SERIES60_3X__

    #include <aknappui.h>
    #include <akntitle.h>
    #include <centralrepository.h> // centralrepository.lib


    #include <msvapi.h>
    #include <mtclreg.h>
    #include <SMSCLNT.h>
    #include <msvstd.h>
    #include <smut.h>
    #include <txtrich.h>
    #include <SMUTHDR.h>


    #else
    #include <QikAppUi.h>
    #endif // __SERIES60_3X__


    class CHelloWorldMainView;

    #ifdef __SERIES60_3X__
    class CHelloWorldAppUi : public CAknAppUi
    #else
    class CHelloWorldAppUi : public CQikAppUi
    #endif
    {
    public: // Constructor and destructor
    void ConstructL();
    ~CHelloWorldAppUi();

    public: // From AppUi
    void HandleCommandL(TInt aCommand);

    #ifdef __SERIES60_3X__
    void HandleResourceChangeL(TInt aType);
    #endif

    private: // Member variables
    CHelloWorldMainView* iMainView;
    CClientMtmRegistry* iMtmRegistry;
    CMsvSession* iSession;
    CSmsClientMtm* iSmsMtm;
    };

    thnks guys who reply

  2. #2
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    i have noted that application is crashing on this line

    iMtmRegistry = CClientMtmRegistry::NewL(*iSession);

  3. #3
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: make new sms in inbox

    What is the panic code?? check system panic code and try to understand problem in your code.
    http://www.symbian.com/Developer/tec...ics/index.html


    Also, i hope you created session to message server (iSession) properly.

  4. #4
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    Panic code. No panic is raised

    The all code I have used is in post. where else do you hope me to create iSession?

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: make new sms in inbox

    Quote Originally Posted by rabaf View Post
    i have noted that application is crashing on this line

    iMtmRegistry = CClientMtmRegistry::NewL(*iSession);
    Quote Originally Posted by rabaf View Post
    Panic code. No panic is raised

    The all code I have used is in post. where else do you hope me to create iSession?
    just you use this http://wiki.forum.nokia.com/index.ph...ded_panic_code to get a panic. If i am not wrong you are getting a panic panic of -46 with means you don't have sufficient capabilities for your application

  6. #6
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    Quote Originally Posted by skumar_rao View Post
    just you use this http://wiki.forum.nokia.com/index.ph...ded_panic_code to get a panic. If i am not wrong you are getting a panic panic of -46 with means you don't have sufficient capabilities for your application
    I added readuserdata, writeuserdata, readdevicedata, writeuserdata, networkservices but same crash

    actually no panic is shown but emulator is closing

  7. #7
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    i don't think capability even matters on emulator

  8. #8
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: make new sms in inbox

    Quote Originally Posted by rabaf View Post
    i have noted that application is crashing on this line

    iMtmRegistry = CClientMtmRegistry::NewL(*iSession);
    Check link provided by skumar_rao, this article defines how to get panic codes.

  9. #9
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    tried and I get following

    ECHO is off.

  10. #10
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    can anyone help by seeing code give in 1st post please?

  11. #11
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: make new sms in inbox

    to make sure are you opening a session (iSession), i donot see any code.

  12. #12
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    Quote Originally Posted by skumar_rao View Post
    to make sure are you opening a session (iSession), i donot see any code.
    Sir, can you guide me how to do that?

    because I am following the exact code in this article.
    http://wiki.forum.nokia.com/index.php/Create_Local_SMS

  13. #13
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: make new sms in inbox

    Quote Originally Posted by rabaf View Post
    Sir, can you guide me how to do that?

    because I am following the exact code in this article.
    http://wiki.forum.nokia.com/index.php/Create_Local_SMS
    Go through the "SMS Example" in forum nokia also check http://wiki.forum.nokia.com/index.ph..._Edition_-_MTM

  14. #14
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: make new sms in inbox

    Quote Originally Posted by rabaf View Post
    Sir, can you guide me how to do that?

    because I am following the exact code in this article.
    http://wiki.forum.nokia.com/index.php/Create_Local_SMS
    You need to open session to message server using following line.
    iSession = CMsvSession::OpenSyncL(*this);

    Also you heve to implement MMsvSessionObserver observer in your class.

  15. #15
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: make new sms in inbox

    Thanks now I am getting this error in the document file.

    illegal use of abstract class ('MMsvSessionObserver::HandleSessionEventL(MMsvSessionObserver::TMsvSessionEvent, void *, void *, void *)')
    please sir help

Similar Threads

  1. How to fake a normal SMS to inbox?
    By luandao2000 in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2011-04-23, 08:26
  2. Unable to delete SMS from inbox
    By kiranpuranik in forum Symbian
    Replies: 25
    Last Post: 2009-12-04, 10:30
  3. How to create .sis file...?
    By satishkatta in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 25
    Last Post: 2008-09-04, 12:43
  4. unable to make SMS unread
    By prateekprithvi in forum Symbian
    Replies: 3
    Last Post: 2008-08-19, 07:48
  5. Replies: 2
    Last Post: 2007-11-10, 13:19

Posting Permissions

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