09.07.2015 Views

VideoSMS/Client Application Programming Interface ... - MCTel

VideoSMS/Client Application Programming Interface ... - MCTel

VideoSMS/Client Application Programming Interface ... - MCTel

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ExamplesExample 9–1 (Cont.)Visual Basic SMS send exampleDim iLg = Len(Src)For i = 1 To Lg Step 1cc = Mid(Src, i, 1)Dest(i - 1) = Asc(cc)NextDest(Lg) = 0End Sub’-----------------------------------------------------------------------------------’ Returns a copy of the ’Src’ character array (format C) as character string’ (format VB)’-----------------------------------------------------------------------------------Private Function CopyCStringToVBString(ByRef Src() As Byte) As StringDim iDim Dest As Stringi = 0Do While Src(i) 0Dest = Dest + Chr(Src(i))i = i + 1LoopCopyCStringToVBString = DestEnd Function’ ======================’ Example of SMS sending’ ======================Private Sub BtEnvoyer_Click()Dim Ret As smsRetDim ConnID As LongDim GatewayAddress As StringDim GatewayAddressLen As LongDim Port As LongDim NbrCredits As LongDim SoftVersion As StringTrace.Caption = "Connection in progress..."Ret = 0’-------------------------------------------------------------’ Connecting to MCTEL SMS Gateway’-------------------------------------------------------------GatewayAddress = "smssmpp.mctel.fr"GatewayAddressLen = Len(GatewayAddress)Port = 80Ret = SMS_ConnectGateway(ConnID, _GatewayAddress, _GatewayAddressLen, _Port)If (Ret SMSNormal) ThenTrace.Caption = "Error SMS_ConnectGateway : " + Str(Ret)MsgBox (Trace.Caption)Exit SubEnd IfTrace.Caption = "SMS_ConnectGateway OK"Example 9–1 Cont’d on next page9–4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!