Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
Gizmo Old
#1  
Guest
Thanks Meter
Posts: n/a
Default XDA and SMS programming

Hello,
I'm new in the wonderful world of XDA and Pocket PC 2002, and I would like to use SMS in a new application. Do you know how I could see example of source code using SMS API? Or do you have such example to help me?

Thanx

Gizmo
Gizmo Old
#2  
Guest
Thanks Meter
Posts: n/a
Default Precision

I forget something important : I'm using eMbedded Visual C++ 3.0!!
Thanx
Gizmo
 
Cheesy
Old
#3  
Junior Member
Thanks Meter 0
Posts: 6
Join Date: Jan 2003
Location: Germany
All you have to do is include SMS.H in your code and linkt to SMS.LIB, see online documentation for more details. Below a simple function which takes a phone number in international format (+491715555555) and the message as parameters ...

Code:
BOOL SendSMS(LPCTSTR pszNumber, LPCTSTR pszMessage)
{
	SMS_HANDLE hSMS;
	HANDLE hGlobalReadSMSEvent; 
	
	HRESULT hResult;
	hResult= SmsOpen(SMS_MSGTYPE_TEXT, SMS_MODE_SEND, &hSMS, &hGlobalReadSMSEvent);
	if(hResult != S_OK)	
	{
		AfxMessageBox(_T("Couldn't open the SMS function"));
		return FALSE;
	}
	
	SMS_ADDRESS smsaDestinationAddress;
	smsaDestinationAddress.smsatAddressType= SMSAT_INTERNATIONAL;	
	wcscpy(smsaDestinationAddress.ptsAddress, pszNumber);

	TEXT_PROVIDER_SPECIFIC_DATA tpsd;
	tpsd.dwMessageOptions = PS_MESSAGE_OPTION_NONE;
	tpsd.psMessageClass = PS_MESSAGE_CLASS3;
	tpsd.psReplaceOption = PSRO_NONE;

	hResult= SmsSendMessage(hSMS, NULL, &smsaDestinationAddress, NULL, (BYTE*)pszMessage, 
		wcslen(pszMessage)*sizeof(WCHAR), (BYTE*)(&tpsd), sizeof(tpsd), SMSDE_OPTIMAL, SMS_OPTION_DELIVERY_NONE, NULL);				

	if(hResult != S_OK)	
	{
		AfxMessageBox(_T("Couldn't send the SMS"));
		return FALSE;
	}

	hResult = SmsClose(hSMS);
	if(hResult != S_OK)	
	{
		AfxMessageBox(_T("Couldn't close the SMS function"));
		return FALSE;
	}

	AfxMessageBox (_T("SMS has been send"));
	return TRUE;
}
Gizmo Old
#4  
Guest
Thanks Meter
Posts: n/a
Default Thanx

Thanx! Thanx!

I made a big mistake : I forgot to link the SMS.LIB....
I'm a beginner!! (and I'm French : I'm sorry for the bad english language!)

Have a great week!

Gizmo
APallares Old
#5  
Guest
Thanks Meter
Posts: n/a
Hello,

Does anybody has a code example for receiving SMS messages?

I've trying to do so for two weeks, and I'm completely lost.

I've read in this site it can't be done with SmsReadMessage or SimReadMessage. Is it correct? What have I to do, using RIL? Or can I use POOM?

Any help would be very appreciated.

APallares
 
andyclap
Old
#6  
Senior Member
Thanks Meter 1
Posts: 182
Join Date: Feb 2003
Location: London
Have you seen tstril? It shows a good way of handling incoming SMSs.
It's here http://xda-developers.com/RIL/
APallares Old
#7  
Guest
Thanks Meter
Posts: n/a
Yes, I've took a look at tstrill. But this example only shows notifications on what's happening on the SMS channels. It has't any reference to the RIL_ReadMsg.

I've searched on the patent documentation, and I have found this help on the RIL_ReadMsg function:

HRESULT RIL_ReadMsg(HRIL hRil, DWORD dwIndex)
Reads a message from the current storage Location
Parameters:
hRil: handle to RIL instance returned by RIL_Initialize
dwIndex:
index of the message to be read
Comments:
Asynchronous. lpData points to an RILMESSAGEINFO structure

My question is: How do I access to lpData?

What I want to do is a function on a DLL like this (in pseudo-code):

BOOL WINAPI ReadSMSMessage(int numMens, LPTSTR Message){
RIL_Initialize
RIL_ReadMessage
RIL_DeInitialize
}

But, what I have to do to get access to "lpData"?

Thanks,

APallares
 
ballrock2
Old
#8  
Junior Member
Thanks Meter 0
Posts: 24
Join Date: Jul 2003
Default SMS.LIB

Have the sms.lib now. Normaly it's delivered with dthe EVC - but the 2 Versions I've got doesn't have it. Get them now by eMail


Maybee, this is the super-beginner-question - sorry

I'm searching for the SMS.lib and SMS.h . Working with MS EVC++ 3.0.
Every time, if I try to compile, I get the message, that the files couldn't been found.

Thougt to get them from the internet - but found them nowhere.

I'm happy about every tip (excluding "you're stupid" ;o)

Greetings from hannovre,
Andreas :o)

[/b]
 
nutitija
Old
#9  
Member
Thanks Meter 0
Posts: 78
Join Date: Apr 2005
Location: Brisbane
Look in ProgramFiles / Windows CE Tools / WCE420 / PocketPC2002 / LIB / Armv4 / all your libraries should be stored there ... in ur code FILE VIEW , Source Files, right click and select add Files to Folder and add your lib

else just #inclde "<the full lib path>"
 
SaBo
Old
#10  
SaBo's Avatar
Senior Member
Thanks Meter 3
Posts: 749
Join Date: Sep 2005
@nutitija
You are aware of the fact that this thread is more than two years old

Sascha
HTC Touch Pro (Raphael), Radio 1.14.25.35, WM 6.5.3 Pro (Energy RAPHAEL 21681 Sense 2.5 Cookie classic GTX Oct. 9)
Qtek 2020 (O2 XDA II) @ 200-530 MHz, Radio 1.19, WM 6.5.5 Pro (Build 28563 WWE 16 MB RAMdisk by aeroflyluby)
--------------------------------------------------------------------------------
Since 24 season 1 we know that all dramatic events take place around the full hour, so don't event bother watching the news at other times

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Open Source CPU Info App for Windows

So you’re playing with your shiny new Windows 8 tablet PC, when one of your like-minded geeky … more

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more