×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    110

    send SMS using Client Mtm Api

    this code should send the sms but it dosen't do i'm successfuly
    create the message and put it in the draft folder
    please read this code and tell me what's the wrong
    and Email me a_shaf3y@yahoo.com

    this class is inherted from CActive class

    iSmsMtm->SwitchCurrentEntryL(iSmsId);

    //load the message
    iSmsMtm->LoadMessageL();

    //set the sms service center address
    CSmsSettings& settings = iSmsMtm->ServiceSettings();
    const TInt numSCAddresses = settings.NumSCAddresses();

    if(numSCAddresses > 0)
    {
    CSmsNumber * serviceCenterNumber = NULL;

    //Get the Default SC address , if valid
    //just get the first from the list
    if((settings.DefaultSC() >= 0) && (settings.DefaultSC()< numSCAddresses ))
    {
    serviceCenterNumber = &(settings.SCAddress(settings.DefaultSC()));
    }
    else
    {
    serviceCenterNumber = &(settings.SCAddress(0));
    }

    iSmsMtm->SmsHeader().SetServiceCenterAddressL(serviceCenterNumber->Address());

    //save the message
    iSmsMtm->SaveMessageL();

    //update the index entry
    indexEntry.SetInPreparation(EFalse);
    indexEntry.SetSendingState(KMsvSendStateWaiting);
    iSmsMtm->Entry().ChangeL(indexEntry);

    //now Sending
    Cancel();
    iEntrySelection->Reset();
    iEntrySelection->AppendL(iSmsId);
    TBuf8<1> dummyParams;


    iOp = iSmsMtm->InvokeAsyncFunctionL( ESmsMtmCommandScheduleCopy
    ,*iEntrySelection , dummyParams , iStatus);

    CActiveScheduler::Add(this);
    TBool addCheck = IsAdded();
    if(addCheck)
    {
    iStatus = KRequestPending;
    iOp->ProgressL();
    SetActive();
    }
    Last edited by kingkiko; 2004-12-14 at 15:21.

Posting Permissions

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