×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    6

    Unhappy Sending SMS Trouble

    I've assembled the following code snippet from samples and books to try and send my first SMS.

    However when I run the following it create a page fault exception. Does anyone know why this may be the case?

    I do end up with a well formed message in my draft message folder so at least I know the first half is working correctly!

    // Address buffer
    _LIT(KAddress,"+447748573307");
    TBufC<14> address(KAddress);

    // Body
    _LIT(KBody,"Test");

    // Create send as object
    CSendAs *sendAs = CSendAs::NewL(*this);

    // Use SMS and the first service
    sendAs->SetMtmL( KUidMsgTypeSMS );
    sendAs->SetService(0);

    // Create the message
    sendAs->CreateMessageL();

    // Add the recipient address
    sendAs->AddRecipientL( address );

    // Set the body
    sendAs->ClientMtm().Body().InsertL(0, KBody );

    // Check message validity
    User::LeaveIfError(sendAs->ValidateMessage());

    // Send the message (this puts it in the drafts folder)
    sendAs->SaveMessageL( ETrue);

    // Get the client mtm
    CBaseMtm &clientMtm = sendAs->ClientMtm();

    // Get the session of the client
    CMsvSession &session = clientMtm.Session();

    // Access registry
    CMtmUiRegistry *mtmUiRegistry = CMtmUiRegistry::NewL( session, 30000000 );

    // Create base mtm ui
    CBaseMtmUi *baseMtmUi = mtmUiRegistry->NewMtmUiL( clientMtm );

    // Find the message entry ID
    TMsvId entryID = clientMtm.Entry().EntryId();

    // Create a selection object
    CMsvEntrySelection *selection = new (ELeave) CMsvEntrySelection();

    // Add the message ID to the selection
    selection->AppendL(entryID);

    // Get the service ID
    TMsvId serviceID = clientMtm.Entry().Entry().iServiceId;

    // Switch client mtm to this service
    clientMtm.SwitchCurrentEntryL(serviceID);

    // Copy the selection to the service !!!! PAGE FAULT EXCEPTION OCCURS IN THESE LINES !!!!
    TRequestStatus status;
    baseMtmUi->CopyToL(*selection, status );

    // Wait for the copying to finish
    User::WaitForRequest( status );

    // Delete the base mtm ui
    delete baseMtmUi;

    // Delete the selection
    delete selection;

    // Delete send as
    delete sendAs;

    I'm grateful for any ideas or help! When looking at the assembler it looks like it is taking the address from the jump table for the "CopyToL" function and that address is bad.

    Thanks,

    Chris

  2. #2
    Registered User
    Join Date
    Apr 2005
    Posts
    6

    Any ideas?

    I am still pretty stuck. I have tried several different methods for sending an SMS and always ended up with a page fault.

    Anybody out there who can help?

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166
    just curious, what is the error note shown saying ?

    yucca

  4. #4
    Registered User
    Join Date
    Apr 2005
    Posts
    6

    Error Message

    Err.. It says something like:

    Error: Page fault

Posting Permissions

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