×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Nov 2003
    Posts
    92

    CSendAs with bluetooth SaveMessageL() fails

    Hello,

    We have a use case that requires us being able to insert a message in the host's inbox (Nokia 9500) as if it had been beamed via bleutooth (in details we receive a number of messages on a "proprietary" channel, and we need to push the "freshest" message in the inbox. The push should resemble a bluetooth beam as much as possible for coherent user experience).

    I use the bluetooth MTM (obtained via CSendAs::AvailableMtms()). After this, I (code pasted at end of message):
    - create the message in inbox
    - set the subject & attachement
    - set the message body (optional)
    - save the message

    If I don't set the message body then everything is ok, the message gets inserted in the inbox (though there is no beep or evnelope icon appearing in status zone).
    If I set the message body, the SaveMEssageL leaves with KErrNotSupported (though I checked the set MTM actually supports both attachements & message body). Confusion... hence my questions:
    - am I doing something wrong (i.e. should I use client MTM directly) ?
    - (cherry on the cake), how is it possible to have the phone beep & display an evnelop to advertize the availability of a new message ???

    Regards,
    Olivier

    PS: code
    Code:
    // Create message in inbox
    iSendAs->CreateMessageL(KMsvGlobalInBoxIndexEntryId);
    		
    iSendAs->SetSubjectL(_L("MySubject"));
    CParaFormatLayer* aParaFormatLayer = CParaFormatLayer::NewL();
    CleanupStack::PushL(aParaFormatLayer);
    CCharFormatLayer* aCharFormatLayer = CCharFormatLayer::NewL();
    CleanupStack::PushL(aCharFormatLayer);
    CRichText* aRichText = CRichText::NewL(aParaFormatLayer,aCharFormatLayer);
    CleanupStack::PushL(aRichText);
    		
    aRichText->Reset();
    aRichText->InsertL(0,_L("Message body"));
    /*Optional, if called SaveMessageL() will crash */
    iSendAs->SetBodyL(*aRichText);
    
    TBuf<128> aAttachment;
    aAttachment.Copy(_L("c:\\index.html"));		
    TFileName directory;
    TMsvId attachId;
    TParse dest;
    // Create the attachment entry
    iSendAs->CreateAttachmentL(attachId, directory);
    dest.Set(directory, &aAttachment, NULL);
    User::LeaveIfError(EikFileUtils::CopyFile(aAttachment, dest.FullName()));
    // Make the attachment visible in the UI
    iSendAs->SetAttachmentL(attachId, dest.NameAndExt());
    
    //If one puts BT loopback address, app crashes... Don't know why
    //iSendAs->AddRecipientL(_L("00:02:03:01:02:FF"));
    //Save message
    TRAPD(err,iSendAs->SaveMessageL(ETrue));
    User::LeaveIfError(err);
    CleanupStack::PopAndDestroy(3);
    delete iSendAs;
    iSendAs = NULL;
    Last edited by olivier_randria; 2005-12-14 at 15:48.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: CSendAs with bluetooth SaveMessageL() fails

    I would use client MTM's directly.

    As a last step (before moving it from draft to inbox), try setting the message un-read, then you should get the phone beeping nicely.

    yucca

  3. #3
    Registered User
    Join Date
    Nov 2004
    Location
    Oulu, Finland
    Posts
    21

    Re: CSendAs with bluetooth SaveMessageL() fails

    Hi, did you happen to find a solution to this problem? I'm facing it currently. It's very strange that the function leaves when the message body is specified. It'd be much more convenient to use CSendAs than to use MTM directly.

    Though I can't find CSendAs from sdk 3.0 documentation, so it might be unwise to start using it now if they removed it in 3.0. I'm using 2nd ed. FP2.

Similar Threads

  1. Replies: 0
    Last Post: 2005-02-28, 14:46
  2. Bluetooth discovery fails w/ error -6033
    By a.ciarkowski in forum Bluetooth Technology
    Replies: 1
    Last Post: 2004-12-05, 08:41
  3. Nokia 7650 support Bluetooth audo?
    By ovjo12 in forum Bluetooth Technology
    Replies: 5
    Last Post: 2003-07-17, 18:50
  4. 6310 bluetooth connection with PCsuite fails
    By Nokia_Archive in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-05-28, 15:14
  5. [How] can I use CSendAs for Bluetooth and infrared
    By Tymchyshyn in forum Bluetooth Technology
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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