.NET Components for Mobility

3.2 Send Problem

Last post 07-25-2008 12:45 PM by PeterFoot. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 04-25-2008 3:54 PM

    3.2 Send Problem

    I updated my DLL today and have encountered a couple problems.  Code that has not changed since the begining is now throwing errors.  The code below is for sending a message.

    Try

    Dim tempto, tempmsg As String

    tempto = txtTo.Text.Trim

    tempmsg = txtMessage.Text.Trim

    Dim MessageToSend As New SmsMessage(tempto, tempmsg)

    'Send the message...

    MessageToSend.Send()

    Catch ex As Exception

    MsgBox("Send:" & ex.Message)

    End Try

    The funny thing is the message actually sends but then throws a NullReferenceException.  As you can see the very last line sends so there is nothign else that could through the error.  On reviewing the SMS Folders the sent messages are not being moved to the SentItems Folder.  That must be where the error is occuring.  Also the the Folder list problem is still occuring.  The messages appear out of order.  The messages are being moved to the folder but they are added at position 1 (2nd Message) instead of position 0 (Top Message).

  • 04-25-2008 5:16 PM In reply to

    Re: 3.2 Send Problem

    I'm looking into this and will post back with progress early next week.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 04-28-2008 6:48 AM In reply to

    Re: 3.2 Send Problem

    It appears to be specific to the SmsMessage(to, body) constructor. A workaround in the short term is to set the From recipient manually before calling send e.g.

     SmsMessage sm = new SmsMessage("1234", "test");

    sm.From = new Recipient(os.SmsAccount.PhoneNumber);

    sm.Send;

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 05-20-2008 10:13 PM In reply to

    Re: 3.2 Send Problem

    Is there an ETA on the next release date?   The work around doesn't always function in the desired manor on all targeted devices.

  • 05-21-2008 5:56 AM In reply to

    Re: 3.2 Send Problem

    The issue with the workaround is that some devices don't expose the PhoneNumber. You can set this to an alternative dummy value if the SmsAccount.PhoneNumber property is empty. At the moment I don't have an ETA for the next version, I won't have a clearer plan for the next version until after TechEd next month.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 07-25-2008 11:13 AM In reply to

    • TreeUK
    • Top 75 Contributor
    • Joined on 01-23-2008
    • Alton, Hampshire
    • Posts 8

    Re: 3.2 Send Problem

    I can confirm I'm now getting this issue after updating the dlls from 3.1 to 3.2.1.

    Code is: 

    SmsMessage smsMessage = new SmsMessage(mobileNumber, message);
    smsMessage.Send();

    Now throws a null reference on the From. OutlookSession.SmsAccount.Phonenumber is blank on the device I'm using so I can't use the new Recipient workaround.

    Having to set the phone number of the device for each of the 40 devices (in the config I'd think) that we're rolling out to is a pretty prohibitive installation overhead.

    Any chance you know what was changed between versions that could have caused this, to fix it?

  • 07-25-2008 11:39 AM In reply to

    Re: 3.2 Send Problem

    This issue is resolved in 3.3. I'm just finialising the installer and will be uploading it later today. The device will populate the phone number itself on sent messages, the SmsAccount.PhoneNumber property is no longer used but is still available if you need it for something else.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 07-25-2008 12:07 PM In reply to

    • TreeUK
    • Top 75 Contributor
    • Joined on 01-23-2008
    • Alton, Hampshire
    • Posts 8

    Re: 3.2 Send Problem

    Awesome stuff, I'll keep an eye out for that. Thanks.

  • 07-25-2008 12:45 PM In reply to

    Re: 3.2 Send Problem

    Version 3.3 is now available.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
Page 1 of 1 (9 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.