Results 1 to 3 of 3

Thread: Display SMS received in a textbox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    17

    Display SMS received in a textbox

    I am working on an SMS project. I want to read an SMS from the sim card of my phone and display it in a textbox. I have tested it on Hyperterminal and it works correctly there. When I type AT+CMGR=index of msg, the message is displayed in the following format:
    +CMGR: "REC READ" , "phone no.", "date and time", "message"[/B]
    OK

    In my VB program I have connected my phone by a USB cable to the PC. Here's my code for the receiving section:-

    MSComm2.Output = "AT+CMGR = 0" & vbCrLf

    Buffer = StrConv(MSComm2.Input, vbUnicode)

    Trace (Buffer)

    where my Trace function is:-

    Private Sub Trace(ByVal message As String) 'used to output the results on the big window

    Dim strLine As String
    strLine = DateTime.Now & " " & message
    txtLog.Text = txtLog.Text & strLine & vbCrLf
    txtLog.SelStart = Len(txtLog.Text)

    End Sub

    My problem is that I cannot display the message received. Instead I can only get OK. What should I do to display the +CMGR: "REC READ" , "phone no.", "date and time", "message"?? Please help me. Thanks.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Display SMS received in a textbox

    Welcome to the forums.

    Is your textbox set to multiline?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2009
    Posts
    17

    Re: Display SMS received in a textbox

    No it's not but it just continues on the same line...

Posting Permissions

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



Click Here to Expand Forum to Full Width