Hi there,
I am trying to program in C# to send/receive SMS via Nokia 6610. The version of PC Connectivity SDK is 3.0
I will be appreciate if someone can share the C# sample to me.
Hi Zamba,
Thanks for your sharing. I have noticed there is no reply from the "SendSMS" method, which means I couldn't know whether the SMS has been sent successful or not. I tried to disconnect the cable between PC and my handphone, and it did not return any exception when "SendSMS" method was called! Do you know how to check whether the mothed is called successfully or not? Thanks a lot!
SendSMS returns void because in a normal program flow you do not need return values. Only in the case of an error a COMException is thrown by the Interop. If there's no phone, you'll get a COMException with the message "No phone connected".
You'll get this exception already when calling the "GetParameters" method in SendSMS because the phone must be connected to get the parameter set.
In my programs I extended this with the PhoneInfo interface (IPhoneInfo4) to detect whether the phone is really connected before attempting to call SendSMS.
Hi Zamba,
Thanks for your explanation. My concern is what if the SMS can't be sent out because of the network jam. For example, at 2004 new year eve, I couldn't send SMS to my friends because too many people were using sms to celebrate the festival. I know the sending was failed because the handphone could let me know, but since the "SendSMS" method doesn't return anything, how can my application know the SMS has been sent out successfully or not if the network traffic is very high?
I really do want to know it because my application must send every SMS successfully.
I expect the SendSMS (of the smsObj) method to also to throw an exception if a network error occurs during sending. I don't know of any other way to find out if the sending failed.
Zamba
Last edited by Zamba; 2004-01-01 at 16:00.
Re: C# sample needed to send/receive SMS URGENT
2006-02-13, 12:39#7
I've encapsulated the code into an assembly and used it with a windows form
The problem arrives when using a WEBFORM.
Lack of permissions in - Solved (see next)
"The machine-default permission settings do not grant Local Activation
permission for the COM Server application with CLSID
{535C2465-05B6-11D2-8C04-00A0C94C5D75}
to the user DDWRK2005\ASPNET SID
(S-1-5-21-1202660629-796845957-839522115-1003). This security permission can
be modified using the Component Services administrative tool."
But now it returns "No Phone connected"
at this line
// Send message
smsObj.SendSMS(ShortMessageRouteType.SHORTMESSAGE_ROUTE_TYPE_ANY, submitObj);
Thanks in advance
Re: C# sample needed to send/receive SMS
2006-02-14, 19:18#8
It should be important to note that the connection manager settings affect the current user only, if you run it from a service, you may have to copy some registry entries to the account that will actually connect to the phone (ASPNET in this case). If you changed it to infrared, then under ASPNET it might still try to connect via serial for example. I just don't remember those exact keys any more, it was something below HKCU\Software\Nokia.
Zamba
Re: C# sample needed to send/receive SMS
2007-06-12, 03:32#9
hello to all of you... im wondering if where can i get that v 3.0 sdk?... i am also looking sdk and code for C# and im glad i see this forum... zamba can you also share code for reciving sms, if it is ok?... thanks in advance
Re: C# sample needed to send/receive SMS
2007-06-12, 03:43#10
Hi, Zamba,
i saw your post regarding sending sms using NokiaCLMessaging under c#.
i tried your code, but i always get "phone not connected" problem.
How do you get your phone connected?
in fact, my phone is already connected to my computer through bluetooth, it can be seen through Nokia PC Suite program.
How did you manage to tell the code that where the phone is?
Colin
Re: C# sample needed to send/receive SMS
2008-06-20, 06:45#12
Your Code made it simple how to send SMS via my phone from My PC
Now problem is when i'm trying to connect it to my web site when i'm running the same code just by including the COM component in the devlopment stage itz working fine. But, I tried to run after deploying it is throwing an error
Creating an instance of the COM component with CLSID {B422B592-AF13-11D4-93F9-0004AC969B31} from the IClassFactory failed due to the following error: 80004005.
I'm using ASP.Net to develop and deploy
Can you suggest me any solution please....
Thanx in advance
Re: C# sample needed to send/receive SMS
2008-07-03, 00:36#13
Can you make available your code "NokiaCLMessaging namespace", where you made all NclMsg.dll imports. I didn't manage to run your sms_send sample, and I think this is the reason ?!
Thanks,
Marco
Re: C# sample needed to send/receive SMS
2008-07-31, 15:34#14