AddAddresseeL leave with KErrNotSupported

Login to reply to this topic.
Mon, 2005-09-26 04:46
Joined: 2005-07-18
Forum posts: 2
If I read SMS message, I can not create a new message using the following code, because the AddAddresseeL() leaves with KErrNotSupported. But I can create a new SMS message without  reading SMS message. What's wrong with it? Do I need two CSmsClientMtm for read and write SMS? Please help me, thanks.

    {
        // Set SMS parameters
    TMsvEntry indexEntry;
    indexEntry.iDate.HomeTime();
    indexEntry.SetInPreparation(ETrue);
   // This is an SMS message
    indexEntry.iMtm = KUidMsgTypeSMS;
    indexEntry.iType = KUidMsvMessageEntry;
   //Gets the ID of the current SMS service.
    indexEntry.iServiceId = iSmsMtm->ServiceId();
   
        // Create entry to drafts
    iSmsMtm->SwitchCurrentEntryL(KMsvDraftEntryId);

   // Creates a new child entry owned by the context synchronously.
    iSmsMtm->Entry().CreateL(indexEntry);

        // Set the MTM's active context to the new message
    iSmsId = indexEntry.Id();
    iSmsMtm->SwitchCurrentEntryL(iSmsId);

        // Add message body. Body is set twice because index entry keeps a copy
   // of some summary information. Index entry and full stored entry
   // must be in sync.
    CRichText& body = iSmsMtm->Body();
    body.Reset();
    body.InsertL(0, aMessage);
    indexEntry.iDescription.Set(aMessage);

        // Add destination address (recipient). Copy address also to the index entry
    if( iSmsMtm->AddresseeList().Count() > 0 )
    {
        CAknInformationNote* informationNote = new (ELeave)CAknInformationNote;
        informationNote->ExecuteLD(_L("大于0"));
    }
    iSmsMtm->AddAddresseeL(aAddress);
    indexEntry.iDetails.Set(aAddress);

        // Commit changes because index entry is only a local variable
    iSmsMtm->Entry().ChangeL(indexEntry);

        // Save full message data to the store
    iSmsMtm->SaveMessageL();
    }

Fri, 2006-11-24 04:29
Joined: 2006-01-25
Forum posts: 24
Re: AddAddresseeL leave with KErrNotSupported
Hi zxliu,

I have the same problem.  Have you found the reason and solution?

Regards
Fri, 2007-04-13 07:23
Joined: 2007-04-13
Forum posts: 1
Re: AddAddresseeL leave with KErrNotSupported
Any solution to this yet?

I have a similar problem with similar code (taken and adapted from the SMS example from Nokia). My application has two views, the first is an text editor view and the second an listbox view for viewing sms messages in the inbox.
The editor view is used first when the application starts.

The sms sending code works perfectly when I stay only in the editor view. I can send messages as many times as I wish and to any recipient. But if I change the view to the listbox view and then return to the editor view, then the sms sending does not work anymore.
The AddAddresseeL keeps returning the "feature not supported" error.
When I changed the location of the call to this method to a later phase in the sms engine code, the "feature not supported" error vanishes, but now the recipient address is just not added to the message. The message stays in the draft -folder and does not have any recipient address. This can be verified with the built-in sms application in the test phone.

Of course this problem does not exist in the emulator. I have tested the application in Nokia 6600 and 6680 phones and both have same behaviour.

Wed, 2007-08-15 13:54
Joined: 2007-04-18
Forum posts: 10
Re: AddAddresseeL leave with KErrNotSupported

Hi all,

It is a little outdated, but I have just fixed this problem in my code :-

void CSMSEngineR::CompleteConstructL()
{
TInt result = 0;
TMsvId id;
// Construct the client MTM registry
iMtmReg = CClientMtmRegistry::NewL(*iSessionR);
if (!iMsvEntry)
{
iMsvEntry = CMsvEntry::NewL(*iSessionR, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
}
// Obtain !!!!!!!!!!!!!!!!!!!!!!TWO!!!!!!!!!!!!!!!!!! MTMs from the MTM registry
iSmsMtmR = static_cast(iMtmReg->NewMtmL(KUidMsgTypeSMS)); // used for receive
iSmsMtmS = static_cast(iMtmReg->NewMtmL(KUidMsgTypeSMS)); // used for send

Using one MTM for transmit and another for receive stops the MTM re-using a header for send after using it to receive, thus
ending up trying to send with a receive header.

Obviously one has to be careful which MTM is used where, but I had already mostly separated the receive and transmit actions paths, in the SendSMS path, and from the HandleSessionEvent call.

Isn't Symbian just wonderful, Don't they test it well!!

Richard

  • Login to reply to this topic.