Sunteți pe pagina 1din 2

SMS READING IN VB6 CODING

ABSTRACT : VB6 CODE TO OPEN ALL SMS FROM GSM MOBILE TO A GRID
COMPONENT : lynxgrid control ,logiccode sms component(trial)

Copy paste the code in a module:

Option Explicit
Global port1 As String
Global brate1 As String
Global dbit1 As String
Global par1 As String
Global stp1 As String
Global flo1 As Integer
Global tm As Double
Global objSMS As lcgsmSMS.GSMSMS
Global datapath1 As String

Copy paste the code in Form load event:

Option Explicit
Global port1 As String
Global brate1 As String
Global dbit1 As String
Global par1 As String
Global stp1 As String
Global flo1 As Integer
Global tm As Double
Global objSMS As lcgsmSMS.GSMSMS
Global datapath1 As String

Private Sub Form_Load()

With LynxGrid1
.EditTrigger = lgEnterKey Or lgMouseClick
.Redraw = False
.AddColumn "SL.", 800, lgAlignLeftCenter
.AddColumn "Message", 5000, lgAlignLeftCenter, , , , True
.AddColumn "time", 1700, lgAlignLeftCenter
.AddColumn "SMSC", 1600, lgAlignLeftCenter
.Redraw = True
End With

''''''''''''''''' read inbox


Dim i As Long
objSMS.COMPort = port1
objSMS.BaudRate = brate1
objSMS.Parity = par1
objSMS.DataBits = dbit1
objSMS.StopBits = stp1
objSMS.FlowControl = flo1
objSMS.InboxMemory = "SM"
objSMS.InboxConcatenate = False
Call objSMS.ReadInbox
If objSMS.InboxCount > 0 Then

For i = 0 To 9
LynxGrid1.AddItem
LynxGrid1.Redraw = False
LynxGrid1.CellText(i, 0) = "" & i + 1
LynxGrid1.CellText(i, 1) = "" & objSMS.InboxMessage(i + 1)
LynxGrid1.CellText(i, 2) = "" & objSMS.InboxTime(i + 1)
LynxGrid1.CellText(i, 3) = "" & objSMS.InboxSMSC(i + 1)

LynxGrid1.Redraw = True

Next i

S-ar putea să vă placă și