Sei sulla pagina 1di 3

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 SMS messages can !e sent using a "SM#"P$S modem, an SMPP provider, an %TTP compliant SMS provider or using a standard dialup or fi&ed'line SMS modem MMS messages can !e sent via a "SM#"P$S modem (MM(), an SMTP server (MM)) or an *M+#S,-P compliant provider (MM.) SMS features/ Send and receive numeric' and alphanumeric te&t SMS messages 0erify delivery of outgoing SMS messages Support for multimedia SMS messages, including ringtones, pictures and logo1s Support for 2-P Push, 2-P 3ookmarks, v4ards, voicemail#e'mail#fa&#MMS indications Support for 5nicode, to support foreign languages like -ra!ic, 4hinese, %e!rew, etc Support for multi'part messages, to allow messages longer than (67 characters Support for "SM modems, "SM phones, SMS#%TTP providers, SMPP (Short Message Peer to Peer) providers, T-P#*8, and 54P dial'in SMS4 providers Support Multi'threading environments The component is thread'safe, which means it can !e used in a multi' threaded environment Samples included for various development platforms/ MS 0isual 3asic, MS 0isual 3asic 9:T, MS 0isual 4;;, MS 0isual Studio 4< 9:T, -SP, -SP 9:T, 3orland Delphi, 3orland 4;; 3uilder, 2indows Powershell 4old=usion and more MMS features/ Support for many multimedia formats incl / >P", "8=, P9", 3MP, 23MP, T8=, 2-0, MP?, M8D8, -4?, "P?, -08, MP", MP), 04-$D, 04-+:9D-$, >-$ and more Support for MM( (MMS over 2-P), MM) (MMS over SMTP) and MM. (MMS over %TM+#S,-P) Pager features/ Send alpha'numeric Pager messages through S9PP This document descri!es how the SMS and MMS Toolkit can !e integrated into 0isual 3asic @ &#6 & proAects

Step 1: Download and install The SMS and MMS Toolkit


Download the SMS and MMS Toolkit from the -ctive*perts Download Site and start the installation The installation guides you through the installation process

Step

: !"eate a new Visual Basic p"o#ect

+aunch 1Microsoft 0isual 3asic1 from the Start menu, and choose 19ew1 from the 1=ile Menu1 The 19ew ProAect1 dialog appears Select 1Standard :&e1 and click 1,K1/ (4lick on the picture to enlarge)

Step $: %e&e" to the SMS and MMS Toolkit 'i("a")


- new ProAect is created, with a !lank form =irst, you must add a reference to the SMS and MMS Toolkit in the proAect to !e a!le to use the SMS o!Aects To do so, choose 1$eferences 1 from the 1ProAect1 menu 8n the 1$eferences1 dialog that pops up, ena!le the -ctive*perts SMS and MMS Toolkit Type +i!rary1 reference as shown in the following picture/ (4lick on the picture to enlarge) 4lick 1,K1 to close the 1$eferences 1 dialog

Then, select the ProAect form and choose 10iew 4ode1 from the conte&t menu/ (4lick on the picture to enlarge) ,n top of your code, declare the following o!Aects/ Dim objGsmProtocol As AXmsCtrl.SmsProtocolGsm Dim objSmsMessage As AXmsCtrl.SmsMessage Dim objSmsConstants As AXmsCtrl.SmsConstants

Step *: Decla"e and c"eate the o(#ects


=rom the 4ode window, select 1=orm1 The Private Su! 1=ormB+oad()1 will !e displayed now 8n the 1=orm +oad1 function, create the "SM o!Aects in the following way/ Set objGsmProtocol = CreateObject("ActiveXperts.SmsProtocolGsm") Set objSmsMessage = CreateObject("ActiveXperts.SmsMessage") Set objSmsConstants = CreateObject("ActiveXperts.SmsConstants")

Step 5: Send SMS +essages


The following code snippet shows how to send an SMS message using a connected "SM phone or modem/ Private S b b ttonSen!"Clic#() Dim $ormat As %ong b ttonSen!.&nable! = $alse te't(es lt.Caption = "Sen!ing message) Please *ait..." te't(es lt.(e+res, - Set Device objGsmProtocol.Device = comboDevice..e't - Set %og$ile objGsmProtocol.%og$ile = te't%og+ile..e't - Set Spee! /+ comboSpee!.%ist/n!e' = 0 .,en objGsmProtocol.DeviceSpee! = 0 - se !e+a lt spee! &lse objGsmProtocol.DeviceSpee! = comboSpee!.%ist(comboSpee!.%ist/n!e') &n! /+ - Set $ormat objSmsMessage.$ormat = objConstants.asM&SSAG&$O(MA.".&X. /+ Sen!Con+ig.c,ec#M ltipart.1al e = 2 .,en objSmsMessage.$ormat = objConstants.asM&SSAG&$O(MA.".&X."M3%./PA(. &n! /+ /+ Sen!Con+ig.c,ec#$las,.1al e = 2 .,en objSmsMessage.$ormat = objConstants.asM&SSAG&$O(MA.".&X."$%AS4 &n! /+ - Set Deliver5 (eport objSmsMessage.(e6 estDeliver5Stat s = Sen!Con+ig.c,ec#(eport.1al e - Set recipient objSmsMessage.(ecipient = te't(ecipient..e't - Set Message parameters objSmsMessage.Data = te'tMessage..e't - Sen! t,e message

objGsmProtocol.Sen!( objSmsMessage ) - Displa5 res S,o*(e+erence Get(es lt (.r S,o*(e+erence lt = .r e e) = $alse

b ttonSen!.&nable! = .r e &n! S b There are many working samples included with the product Cou can also find them on the -ctive*perts =TP site/ftp active&perts'la!s com#samples#mo!ile'messaging'component

Potrebbero piacerti anche