Windows CE & Pocket PC

Moderators: None (Apply to moderate this forum)
Number of threads: 324
Number of posts: 425

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Problem of SmsOpen for reading an SMS Posted by jidtrawadee on 9 Jul 2007 at 11:57 PM
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)

Report
Re: Problem of SmsOpen for reading an SMS Posted by sanjeev123 on 17 Sept 2008 at 11:27 PM
: 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)
:
:


I think that before we open a handle to the inbox we should make sure that no other application has an handle to inbox,so i have stopped tmail.exe which always holds an handle to the inbox then only am able to open the inbox for reading



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.