Download ActiveXperts SMS and MMS Toolkit 5.1  (6826 KB - .exe file)
Download Manual  (623 KB - .htm file)
Using The SMS and MMS Toolkit with Visual Basic 5.x/6.x
The SMS and MMS Toolkit is a software development kit (SDK) to enhance an application or script with SMS, MMS and Pager functionality.
An SMS messages can be sent using a GSM/GPRS modem, an SMPP provider, an HTTP compliant SMS provider or using a standard dialup or fixed-line SMS modem.
An MMS messages can be sent via a GSM/GPRS modem (MM1), an SMTP server (MM4) or an XML/SOAP compliant provider (MM7).
SMS features:
- Send and receive numeric- and alphanumeric text SMS messages
- Verify delivery of outgoing SMS messages
- Support for multimedia SMS messages, including ringtones, pictures and logo's
- Support for WAP Push, WAP Bookmarks, vCards, voicemail/e-mail/fax/MMS indications
- Support for Unicode, to support foreign languages like Chinese, Turkisch, etc.
- Support for multi-part messages, to allow messages longer than 160 characters
- Support for GSM modems, GSM phones, SMS/HTTP providers, SMPP (Short Message Peer to Peer) providers, TAP/XIO and UCP dial-in SMSC providers
- Support Multi-threading environments. The component is thread-safe, which means it can be used in a multi-threaded environment
- Samples included for various development platforms: MS Visual Basic, MS Visual Basic .NET, MS Visual C++, MS Visual Studio C# .NET, ASP, ASP .NET, Borland Delphi, Borland C++ Builder, ColdFusion and more
MMS features:
- Support for many multimedia formats incl.: JPG, GIF, PNG, BMP, WBMP, TIF, WAV, MP3, MIDI, AC3, GP3, AVI, MPG, MP4, VCARD, VCALENDAR, JAR and more
- Support for MM1 (MMS over WAP), MM4 (MMS over SMTP) and MM7 (MMS over HTML/SOAP)
Pager features:
- Send alpha-numeric Pager messages through SNPP
This document describes how the SMS and MMS Toolkit can be integrated into Visual Basic 5.x/6.x projects.
Step 1: Download and install The SMS and MMS Toolkit
Download the SMS and MMS Toolkit from the ActiveXperts Download Site and start the installation.
The installation guides you through the installation process.
Step 2: Create a new Visual Basic project
Launch 'Microsoft Visual Basic' from the Start menu, and choose 'New' from the 'File Menu'. The 'New Project' dialog appears.
Select 'Standard Exe' and click 'OK':

(Click on the picture to enlarge)
Step 3: Refer to the SMS and MMS Toolkit Library
A new Project is created, with a blank form.
First, you must add a reference to the SMS and MMS Toolkit in the project to be able to use the SMS objects.
To do so, choose 'References...' from the 'Project' menu.
In the 'References' dialog that pops up, enable the ActiveXperts SMS and MMS Toolkit Type Library' reference as shown in the following picture:

(Click on the picture to enlarge)
Click 'OK' to close the 'References...' dialog.
Then, select the Project form and choose 'View Code' from the context menu:

(Click on the picture to enlarge)
Step 4: Declare and create the objects
On top of your code, declare the following objects for SMPP:
Dim objSmppProtocol As AXmsCtrl.SmsProtocolSmpp
Dim objSmsMessage As AXmsCtrl.SmsMessage
Dim objSmsConstants As AXmsCtrl.SmsConstants
From the Code window, select 'Form'. The Private Sub 'Form_Load()' will be displayed now.
In the 'Form Load' function, create the SMS objects in the following way:
Set objSmppProtocol = CreateObject("ActiveXperts.SmsProtocolSmpp")
Set objSmsMessage = CreateObject("ActiveXperts.SmsMessage")
Set objSmsConstants = CreateObject("ActiveXperts.SmsConstants")
Step 5: Send SMS messages
The following code shows how to send an SMS message:
Option Explicit
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Const MAX_PATH = 260
Public objSmppProtocol As AXmsCtrl.SmsProtocolSmpp
Public objSmsMessage As AXmsCtrl.SmsMessage
Public objSmsConstants As AXmsCtrl.SmsConstants
Public objStatus As AXmsCtrl.SmsDeliveryStatus
Private Sub Connect_Click()
MousePointer = vbHourglass
objSmppProtocol.Server = TextServer.Text
objSmppProtocol.SystemID = TextSystemID.Text
objSmppProtocol.SystemPassword = TextPassword.Text
objSmppProtocol.SystemType = TextSystemType.Text
objSmppProtocol.ServerPort = TextServerPort.Text
objSmppProtocol.LogFile = TextLogFile.Text
objSmppProtocol.ServerKeepAlive = 60
objSmppProtocol.ServerTimeout = 5000
'objSmppProtocol.SystemVersion = objSmsConstants.asSMPPVERSION_34
objSmppProtocol.SystemMode = objSmsConstants.asSMPPMODE_TRANSMITTER
objSmppProtocol.Connect
If GetResult = 0 Then
TextRecipient.Enabled = True
TextMessage.Enabled = True
ListView1.Enabled = True
Disconnect.Enabled = True
Connect.Enabled = False
Send.Enabled = True
End If
MousePointer = vbDefault
End Sub
Private Function Disc()
MousePointer = vbHourglass
objSmppProtocol.Disconnect
TextRecipient.Enabled = False
TextMessage.Enabled = False
ListView1.Enabled = False
Disconnect.Enabled = False
Connect.Enabled = True
Send.Enabled = False
MousePointer = vbDefault
End Function
Private Sub Disconnect_Click()
Disc
End Sub
Private Function SetDefaultLogFile()
Dim Buffer As String
Buffer = Space(MAX_PATH)
If GetTempPath(MAX_PATH, Buffer) <> 0 Then
TextLogFile.Text = Left$(Buffer, InStr(Buffer, vbNullChar) - 1) & "SmppLog.txt"
Else
TextLogFile.Text = "C:\SmppLog.txt"
End If
End Function
Private Sub Form_Load()
Set objSmppProtocol = CreateObject("ActiveXperts.SmsProtocolSmpp")
Set objSmsMessage = CreateObject("ActiveXperts.SmsMessage")
Set objSmsConstants = CreateObject("ActiveXperts.SmsConstants")
SetDefaultLogFile
End Sub
Private Function GetResult() As Long
Dim lResult As Long
lResult = objSmppProtocol.LastError ' Get Last Error
TextResult.Text = "ERROR " & objSmppProtocol.LastError & " ( " & objSmppProtocol.GetErrorDescription(lResult) & " )" ' Set Result
GetResult = lResult
End Function
Private Sub Send_Click()
Dim strReference
If objSmppProtocol.IsConnected = False Then
Disconnect_Click
End If
objSmsMessage.Recipient = TextRecipient.Text
objSmsMessage.Data = TextMessage.Text
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_TEXT
objSmppProtocol.LogFile = TextLogFile.Text
strReference = objSmppProtocol.Send( objSmsMessage )
If GetResult = 0 Then
Dim lList As ListItem
Set lList = ListView1.ListItems.Add(, , strReference) ' Add data to list control
lList.SubItems(1) = objSmsMessage.Recipient
lList.SubItems(2) = "n/a"
lList.SubItems(3) = "Submitted"
End If
End Sub
Private Function Query()
Dim i As Integer
If objSmppProtocol.IsConnected = False Then
Disconnect_Click
End If
For i = 1 To ListView1.ListItems.Count
Dim lList As ListItem
Set lList = ListView1.ListItems(i)
If lList.SubItems(2) = "n/a" Then
On Error Resume Next
Set objStatus objSmppProtocol.QueryStatus ( ListView1.ListItems(i).Text )
On Error Goto 0
If objSmppProtocol.LastError = 0 Then
lList.SubItems(2) = objStatus.StatusCompletedTime
lList.SubItems(3) = objStatus.StatusDescription
End If
End If
Next
End Function
Private Sub Timer1_Timer()
Query
End Sub
Private Sub Form1_Unload()
Disc
End Sub
Private Sub View_Click()
If FileExists(TextLogFile.Text) = True Then
Shell "notepad " + TextLogFile.Text, vbNormalFocus
End If
End Sub
Public Function FileExists(sFileName As String) As Boolean
FileExists = CBool(Len(Dir$(sFileName))) And CBool(Len(sFileName))
End Function
There are many working samples included with the product.
You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/xmstoolkit.
The ActiveXperts SMS and MMS Toolkit is a SMS development component (SDK). This control can be used by any Windows development platform,
including Visual Basic .NET, Visual CSharp .NET,
ASP .NET (VB,CS),
ASP,
Visual Basic,
Visual Basic for Applications (VBA),
Visual Studio/Visual C++,
Borland Delphi and
C++ Builder,
PHP,
ColdFusion,
HTML,
VBScript and any other ActiveX/COM compliant platform. The SMS and MMS Toolkit is an ActiveXperts Software B.V. Product.
|