×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    123

    CreateMessageL crash emulator

    Hi.
    I trying to send SMS. I changed code from that web site :
    HTML Code:
    http://wiki.forum.nokia.com/index.php/Sending_SMS_in_S60_3rd_Edition_-_MTM
    , I removed some code, becouse I don`t want to receive SMS. I want to create SMSSender object and automaticly send SMS. it`s part of my code:

    Code:
    void CSMSSender::ConstructL(TBuf<255> aPhoneNo, TBuf<255> aMessage)
        {
        iPhoneNo = aPhoneNo;
        iMessage = aMessage;
        
        // Session to message server is opened asynchronously.
        iSession = CMsvSession::OpenAsyncL( *this );
        
        // Create an MTM Registry object.
        iMtmRegistry = CClientMtmRegistry::NewL( *iSession );
     
        // Create an SMS Client MTM object.
        iSmsMtm = STATIC_CAST( CSmsClientMtm*, iMtmRegistry->NewMtmL( KUidMsgTypeSMS ) );
        
        CreateSMS();
        }
    In CreateSMS() application crasch on line iSmsMtm-> CreateMessageL( KUidMsgTypeSMS.iUid );
    Emulator crash, and i cant see Panic Code.

    Code:
    void CSMSSender::CreateSMS()
        {
        // Current entry is the Draft folder.
            iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
         
            // Create a new SMS message entry as a child of the current context.
            iSmsMtm-> CreateMessageL( KUidMsgTypeSMS.iUid );
        //...
    It`s part of my *.h file

    Code:
    class CSMSSender : public CActive, public MMsvSessionObserver
    {
    //...
    }
    Am I not initalising variables of some kind?

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: CreateMessageL crash emulator

    TRAP (err,iSmsMtm-> CreateMessageL( KUidMsgTypeSMS.iUid )); and check the error code.

    Check if iSmsMtm created successfully.
    Regards,
    Shafali

  3. #3
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    123

    Re: CreateMessageL crash emulator

    shafai I already tried TRAP

    TInt err;
    TRAP (err,iSmsMtm-> CreateMessageL( KUidMsgTypeSMS.iUid ));

    but emulator crash still, so I can`t debug and check err;

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,671

    Re: CreateMessageL crash emulator

    You can still check the logfile, its last line probably contains the error message: http://wiki.forum.nokia.com/index.php/Epocwind.out
    The emulator thing is just a matter of configuration: http://wiki.forum.nokia.com/index.ph...arbide.c%2B%2B

  5. #5
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    123

    Re: CreateMessageL crash emulator

    Thanks for your time and help.
    Panic code is KERN-EXEC 3. I don`t know what I have to do. Below it`s my *.h file. Maybe it help.

    Code:
    /*
    
    #ifndef SMSSENDER_H
    #define SMSSENDER_H
    
    // INCLUDES
    #include <e32std.h>
    #include <e32base.h>
    
    #include <msvapi.h>
    #include <mtuireg.h>
    #include <txtrich.h>
    
    //deklaracja klas
    class CSmsClientMtm;
    
    /**
     *  CSMSSender
     * 
     */
    class CSMSSender : public CActive, public MMsvSessionObserver
        {
    public:
        // Constructors and destructor
    
        /**
         * Destructor.
         */
        ~CSMSSender();
    
        /**
         * Two-phased constructor.
         */
        static CSMSSender* NewL(TBuf<255> aPhoneNo, TBuf<255> aMessage);
    
        /**
         * Two-phased constructor.
         */
        static CSMSSender* NewLC(TBuf<255> aPhoneNo, TBuf<255> aMessage);
        
        /**
         * Od MMsvSessionObserver
         */
        void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1,
                                  TAny* aArg2, TAny* aArg3 );
        
    protected: // Functions from base classes
    
        /**
        * From CActive, DoCancel.
        * Cancels any outstanding requests.
        */
        void DoCancel();
    
        /**
        * From CActive, RunL.
        * Handles an active object’s request completion event.
        */
        void RunL();
    
    private:
    
        /**
         * Constructor for performing 1st stage construction
         */
        CSMSSender();
    
        /**
         * EPOC default constructor for performing 2nd stage construction
         */
        void ConstructL(TBuf<255> aPhoneNo, TBuf<255> aMessage);
        
        /**
         * Tworzy obiekt SMS
         */
        void CreateSMS();
        
        void ScheduleL();
        
    private:
        
        /**
         * Phone no
         */
        TBuf<255> iPhoneNo;
        
        /**
         * SMS text
         */
        TBuf<255> iMessage;
        
        /**
        * TState, enumy używane w RunL(
        */
        enum TState
            {
            EWaitingForMoving = 1,
            EWaitingForScheduling
            };
        
        /**
        * iState, the state of the handler.
        */
        TState iState;
    
        /**
        * iSession, the contact database.
        * Owned by CSmsHandler object.
        */
        CMsvSession* iSession;
    
        /**
        * iMtmRegistry, client MTM registry.
        * Owned by CSmsHandler object.
        */
        CClientMtmRegistry* iMtmRegistry;
    
        /**
        * iSmsMtm, SMS specific Client MTM.
        * Owned by CSmsHandler object.
        */
        CSmsClientMtm* iSmsMtm;
    
        /**
        * iOperation, the current message server operation.
        * Owned by CSmsHandler object.
        */
        CMsvOperation* iOperation;
        /**
        * iMtmUiRegistry, User Interface MTM Registry.
        * Owned by CSmsHandler object.
        */
        CMtmUiRegistry* iMtmUiRegistry;
    
        };
    
    #endif // SMSSENDER_H
    Please help

  6. #6
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    123

    Re: CreateMessageL crash emulator

    Still can`t solve my problem. I copied SMSHandler.h and SMSHandler.cpp file to my project. Than in other class`s ConstructL() I initialized SMSHandler, and tried to send SMS like that

    Code:
        CSmsHandler* handler = CSmsHandler::NewL();
        handler->SendL(_L("123456789"),_L("Test msg"));
    but in CreateMsgL() in line

    Code:
    iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
    emulator crash with Panic KERN-EXEC 3 code.

    Class whith I initialize SMSHandler extends public CCoeStatic.

    I want to my application sens SMS after started.

  7. #7
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    123

    Re: CreateMessageL crash emulator

    I solved my problem.

    I created CMsvSession synchronicity, not asynchronicity.

    Code:
    iSession = CMsvSession::OpenSyncL( *this );
    not
    iSession = CMsvSession::OpenASyncL( *this );

Similar Threads

  1. RArray of struct makes emulator crash
    By strike_noir in forum Symbian
    Replies: 10
    Last Post: 2008-11-02, 15:27
  2. WLAN Connection from Emulator
    By capri07 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2007-12-13, 05:13
  3. crash when trying internet connection in 2nd ed fp2 emulator
    By simo.salminen in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-03-09, 07:30
  4. Crash in eglCopyBuffers on S60 2.6 emulator
    By storsjo in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-02-23, 21:09

Posting Permissions

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