I am coding a messaging program on Windows Mobiles 6.0, but there is a problem in reading SMS. My codes of SmsOpen(…) are
SMS_ADDRESS smsaDestination;
TEXT_PROVIDER_SPECIFIC_DATA tpsd;
SMS_HANDLE smshHandle;
HANDLE hRead = CreateEvent (NULL, FALSE, FALSE, NULL);
// Open an SMS Handle
HRESULT hr = SmsOpen (SMS_MSGTYPE_TEXT, SMS_MODE_RECEIVE,
&smshHandle, &hRead);
if (hr != ERROR_SUCCESS) {
printf ("SmsOpen fail %x %d\r\n", hr, GetLastError());
return 0;
}
.
.
.
However there is an error when calling
SmsOpen(SMS_MSGTYPE_TEXT,SMS_MODE_RECEIVE, &smsHandle, &hRead).
The error message is “Another application already has the SMS system open.” And there is not error if I use SMS_MODE_SEND.
I had already searched in many books and website, but I found only code that I used. Are there anyone know how to solve this problem?
Thank you.
Jidtrawadee Cheewatanon
jidtrawadee@hotmail.com
(Thailand)