Booking your table no. through sms... i need to do a project regarding this using vb 6.0 any help from any pros' here.. mayb u can edit from my attached file.
My dead line is in 2 weeks time:(
Printable View
Booking your table no. through sms... i need to do a project regarding this using vb 6.0 any help from any pros' here.. mayb u can edit from my attached file.
My dead line is in 2 weeks time:(
Well, jason, there's a lot of files mising. You only sent the .vbp and there is nothing in it for us to edit.
You have to send all files from your projects folder.
Err what file do i need to upload too can name them? cause i only open the whole project using this file...
Well, there is at least the form file missing. It seems to be named Lab3_2.frm If graphical elements are contained, a file Lab3_2.frx would be there, too.
You should have the complete project in one folder, so best put everything in zip and upload it.
Wof here's my file sry for e late reply....:)
Ok let's get started somehow.
First a few suggestions:
For my modem works with different settings I'd have to rewrite every
Put this code in a Sub InitModem() and call it from Form_Load().Code:MSComm1.CommPort = 1
MSComm1.Settings = "115200,n,8,1"
MSComm1.PortOpen = True
MSComm1.RTSEnable = True
Use MSComm1.PortOpen = False to close the port only once, in Form_Unload(), so the port stays open all the time while the program is running.
This eliminates the many port initialisations and if I get another upload from you I only have to switch to my settings to test it, once.
As how to organize an SMS program I have attached you a neat and easy sample from another guy here from the forums (can't remember who it was).
It is not too complicated and maybe gives you a clue or another. Please try to study it.
The main difference is, you are directly sending to the modem and then listening for the answer.
The sample works with the _OnComm() event of the MSComm control. It is executed whenever a character is received. The complete answer is assembled like that and then interpreted.
I hope this helps you as a first step. If you have difficulties in understanding the concepts, come back for more. Meanwhile I will try to find some time to get your sample working with my modem.
hi i try to run it but it comes with a error
compile error
method or data not found
and so sorry i still dont get it at all, how to use it. i am a complete idiot in this
Odd. I just installed VB6 a month ago, with SP6, and now I find I don't have mscomm32.ocx installed! Don't know what happened, but I found it in an old folder. You can download it with any vb6 app that uses a modem.
The SMS program has other problems. A module is likely missing.
Code:Set SMS_Conn = New Shared_Connections
Set SMS_Server = SMS_Conn.GetHandle
The program was not written by me, but I found it quite useful when seeing how things were done.
Please comment out these two lines. They might refer to some class the author was preparing to create. If they are commented out, the program communicates perfectly with your modem.
Check in Sub Initialise_Modem() if the settings
Comm1.CommPort = 3
Comm1.Settings = "19200,n,8,1" (I think you had 115200)
are suitable for your modem.
If you find this too complicated, we can try to go back to your first attempt and rebuild it step by step to get it run.
WoF - Do you have MSCOMM32.OCX? For some reason, I didn't, and I just installed vb6 w/sp6 after formatting on xp media center. It is probably somewhere on your machine, but I don't remember where.
Even my DIALER sample crashes without it!
Sure I have. Without it I wouldn't get communication with my SMS terminal.
It must reside in WINDOWS\SYSTEM32 folder.
Do you want me to post it for you, or can you download from M$?
Usually it comes with VB6/VS6. After installing VB6 you should have it. You should still have it after installing SP6.
I found it in a backup folder from an app that I downloaded, but I assume that I had it at one point on the last machine, as I've run DIALER sample.
I've installed that copy in \system32 but I wondered if that was the problem initally, as I found out.
I've seen that you can download from a few sites, but rather than post it, I wanted to find out where my copy went. I posted in the newsgroup, so I'll see if any MVP's answer.
ya i strongly agree wid u wof mayb we should juz start from my project... 1st of all can u help mi turn it into an auto reply whenever an integer is send to a modem?
btw wof u have saw my flowchart rite? i think i nid a database?
I saw your flowchart and think a database would be a little overdone for that purpose.
I would go for a simple text file, having records like:
Table#=Size, example 1=8 meaning table 1 has room for 8 people.
Unless you want to store reservations for next week or so.
Your flowchart does not even imply any reservation date, so i assumed it's just an in-memory application.
Huh? I don't understand. You dont send integers to the modem. You always send clean ASCII text, values are sent as strings. Also anything sent to the modem is usually an AT command.Quote:
1st of all can u help mi turn it into an auto reply whenever an integer is send to a modem?
What do you mean by auto reply?
@David: Please keep me informed if you find out how you lost the file. :)
oh wad i mean is when i send a format like (table for (2-8)-daniel) . my program will auto reply with a table no. to e customer via this format (Daniel your table no. 2 had been reserves. Table reservation will be void in 3 hours). if wrong format is send it will reply wrong format please send your sms in this format (table for (2-8)-(name)).
Hmmm. I wonder if I didn't have the modem driver installed when I installed vb? I didn't need it, so I waited for a few weeks. Otherwise the only other difference is that this is XP Media Center 2005 where it was XP Pro before.
EDIT: Just looked at an old backup. The same file is there. I might have installed it myself before also. Very strange indeed.
@David: **** happens. Don't forget: It's Windows. :rolleyes:
Ok, Jason.
Your format table (2-8) meaning for 2 persons at 8 o'clock?
Well to get started I will send you later this day some cleaned up version of your program which we both can run to make things easier with finding errors, right?
So here it comes.
Please look at what I did. I put all port opening in Form_Load().
If you set the constant #Wof to 0 your settings are chosen. I can adapt by setting Wof to 1 when I have to try out stuff with my modem.
I have written a small routine GetModemResponse.
Look in Command1_Click() and Command2_Click() how it is used.
You might use it wherever an answer from the modem is waited for.
Only drawback is, my SMS terminal can send SMS, but cannot receive'm. So I can only simulate the receiving part here.
what i mean is when i send a even no. to this hp no. it will reply me with a table no. example- Daniel table for 4. then it will reply your table no() is being reserve. if wrong format is send it will reply with sorry wrong format inserted.
Yes? What's the problem?
You have managed to communicate with the modem.
I don't know how your modem works. Possibly you'd have to poll if an SMS has been received.
If so, you have already the routine to read the message. Just put it into a separate sub.
Then check the contents of the text for your desired syntax.
Are you having problems with string functions?
You wanted a format like: Name, #of persons
So you make an array, split up the message at the "," and analyse it
That should give you an idea...Code:dim reply$()
reply = Split(LCase$(sms$, ","))
'now reply(0) would contain the name, reply(1) the number of persons
If UBound(reply)<1 Then 'wrong format, no comma
If val(reply(1)) =0 Then 'error number of persons not recognized
Sorry i dun see any different in the project that you pass to mi
Private Sub Command1_Click()
Dim FromModem As String
MSComm1.Output = "AT+CNMI=0,1,0,0,0" + vbCr
FromModem = GetModemResponse
Picture1.Cls
Picture1.Print FromModem
MSComm1.Output = "AT+CMGF=1" + vbCr
FromModem = GetModemResponse
Picture1.Print FromModem
If MSComm1.InBufferCount > 0 Then Picture1.Print GetModemResponse
Private Sub Command2_Click()
Dim FromModem As String
MSComm1.Output = "AT+CMGR=" + Text1.Text + vbCr
Sleep 500
FromModem = GetModemResponse
Picture1.Cls
Picture1.Print FromModem
i also face another proplem is when i run the program it have a error with the com port
What kind of error is it? You need to be more specific for anybody to be able to help you.
As I recall you'd have to go to the Form_Load() and adapt the settings of the MSComm to your individual needs...
ok i am getting to understand this... sorry coz i am quite a newbie in this.
dim reply$()
reply = Split(LCase$(sms$, ","))
'now reply(0) would contain the name, reply(1) the number of persons
If UBound(reply)<1 Then 'wrong format, no comma
If val(reply(1)) =0 Then 'error number of persons not recognized
the code that u gave me.
i create a new timer and paste it in. Is it correct but it aint replying me at all.
so what muz i do to make it happen my deadline in almost:(
nez week i will be dead
Sorry Friends,Quote:
Originally Posted by dglienna
Just Remove those two lines
And the sample will work.Code:Set SMS_Conn = New Shared_Connections
Set SMS_Server = SMS_Conn.GetHandle
1. The sample displays all the messages received in a grid.
2. you can select a message on the grid and click read particular message
and i am sorry as it was a sample programme, I missed many details there
for example to send the SMS
Set the Caption of the TO Label with a mobile number to send
type the message and click send , There the SMS goes .
Sorry.
Hello WoF
Regarding VB6 and SMS
I need to contact you, I didn't found any way to send you a private message to you on this forum. Please email me at ... [email address removed]
Kind regards
If you have a question then you should start a thread of your own rather than post in one that is several years old, also you should not post your email address in the public areas, unless of course you like to get spam.
Thank you for the email removing ! I tried it but without sucess.
I tried to contact a member that I think has the solution for my problem.
Kind regards
I'll start a new thread to know if someone can help me !
Regards