المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : gsmcomm help



C# Programming
02-05-2010, 11:23 PM
Hie guys:

I am developing an sms application using c# and gsmcomm library and im using nokia 6500 slide as my gateway. I can connect to the phone and send messages from the application. I am using the sample code from
How To Send and Receive SMS using GSM Modem (http://www.codeproject.com/KB/cs/SMS.aspx?msg=2697380#xx2697380xx)[^ (http://www.codeproject.com/KB/cs/SMS.aspx?msg=2697380#xx2697380xx)]

Now i want to send sms automatically according to the user's request, which is not a problem but the problem is method comm_MessageReceived
CommSetting.comm.MessageReceived+=new MessageReceivedEventHandler(comm_MessageReceived)
is not being triggered when someone sennds the sms. I googled and got the extract below to enable message notification

this.GSM.MessageReceived += new MessageReceivedEventHandler(comm_MessageReceived);
this.GSM.EnableMessageNotifications();

In my application "this" doesnt have GSM instead in my analysis i used CommSetting.comm.EnableMessageNotifications() which is giving me exception "Port Not Open".
Help me, how can i enable it so that i may automate my replies