Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SMS ActiveX
Message
From
29/01/2004 23:19:40
Maltin Lacsina
Angeles Electric Corporation
Angeles, Philippines
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
SMS ActiveX
Miscellaneous
Thread ID:
00872178
Message ID:
00872178
Views:
68
Can I translate this VB code in VFP?

Option Explicit
Public WithEvents nSMS As GI32Nokia.SMS

Private Sub cmdGetMessagesArray_Click()
'This will show you how to retrieve full SMS list as array
Dim SMSData As Variant
'Parameter of this function means - retrieve data from
'SIM card or not... Read help to see why :)
SMSData = nSMS.GetMessagesArray(True)
'Now check if we got what we wanted
If Not IsArray(SMSData) Then
'Nope, we didn't...
MsgBox "No messages or error occured", vbExclamation, "No data to show"
Exit Sub
End If
If UBound(SMSData) = 0 Then
MsgBox "No messages on phone"
Exit Sub
End If
'Seems everything is fine if we are here...
Me.lstMessages.Clear
Dim I As Integer 'Just hope they will not increase phone memory above 32767...
For I = 1 To UBound(SMSData)
'Very important - array begins with element 1, not 0!
'Second dimension have 3 elements, 1 to 3 - 1-From, 2-Date, 3-Message
If SMSData(I, 1) <> "" Then Me.lstMessages.AddItem I & ". " & SMSData(I, 1) & Chr(9) & SMSData(I, 2)
Next I
End Sub

Private Sub cmdGetMsgs_Click()
nSMS.GetMessages
End Sub



Private Sub cmdSMSend_Click()
frmSendSMS.Show
End Sub

Private Sub Command1_Click()
Dim X As VbMsgBoxResult
X = MsgBox("Are you sure you want to clean ALL messages from your phone?", vbQuestion + vbYesNo + vbDefaultButton2, "Confirm")
If X = vbNo Then Exit Sub
'Well, you said.
nSMS.FullMemoryCleanup True 'Kill messages that been read already
End Sub

Private Sub Form_Load()
Set nSMS = New GI32Nokia.SMS
'AutoKill means - messages will be erased upon receipt
nSMS.AutoKill = False
'Enable listening for events, like SMS receiving...
'Note, that you cant (so, dont need) use events in ASP,
'so it is disabled by default.
nSMS.EventsEnabled True
Me.lblSCNum.Caption = Me.lblSCNum.Caption & nSMS.ServiceCenter
Me.txtMes.Text = "SMS in phone memory: " & nSMS.SMSOnPhone + nSMS.SMSOnSIM
End Sub

Private Sub nSMS_Error(ErrorMessage As String)
MsgBox ErrorMessage, vbCritical, "Error!"
End Sub

Private Sub nSMS_NewSMS(FromNumber As String, Message As String, Received As Date)
AddText "From: " & FromNumber
AddText "Received: " & Received
AddText Message
AddText "**********" & vbCrLf
End Sub

Private Sub AddText(ByVal Text As String)
Me.txtMes.Text = Me.txtMes.Text & Text & vbCrLf
End Sub
Minds are like parachutes. They only function when they are open.
Reply
Map
View

Click here to load this message in the networking platform