Guest
2011-04-27T16:40:54Z
Hi Guys

Im having some difficulties getting the API to work correctly in VB. Ive added in the reference file and ive made some amendments to the source provided in the instructions as shown below.

Public Class Form1
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim IntelliSMS As New INTELLISMSLib.IntelliSMS
Dim TeleNumber As String
Dim Body As String

TeleNumber = TextBox1.Text
Body = TextBox2.Text

IntelliSMS.Username = "******"
IntelliSMS.Password = "*******"
IntelliSMS.ProxyAddress = "**.**.**.**:****"
IntelliSMS.ProxyUsername = "*******"
IntelliSMS.ProxyPassword = "*******"
Dim MessageId As Object
Dim Result As INTELLISMSLib.ResultCodes
Result = IntelliSMS.SendMessage _
(TeleNumber, Body, "SENDER_ID", MessageId)
End Sub
End Class

I keep getting an error relating to MessageID -

Warning 1 Variable 'MessageId' is passed by reference before it has been assigned a value. A null reference exception could result at runtime. D:\Documents and Settings\cordega\My Documents\Visual Studio 2008\Projects\Test\Form1.vb 18 41 Test

At present i havent added in the ability to reply to the messages this will be added in time but is there something im missing relating to the messageID.
Support
2011-04-28T09:18:16Z
Please try adding code in bold:



Public Class Form1
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim IntelliSMS As New INTELLISMSLib.IntelliSMS
Dim TeleNumber As String
Dim Body As String

TeleNumber = TextBox1.Text
Body = TextBox2.Text

IntelliSMS.Username = "????????"
IntelliSMS.Password = "????????"
IntelliSMS.ProxyAddress = "**.**.**.**:****"
IntelliSMS.ProxyUsername = "*******"
IntelliSMS.ProxyPassword = "*******"
Dim MessageId As Object

MessageId = 0

Dim Result As INTELLISMSLib.ResultCodes
Result = IntelliSMS.SendMessage _
(TeleNumber, Body, "SENDER_ID", MessageId)
End Sub
End Class



Similar Topics
Users browsing this topic