Re: call SMS functions from driver
- From: "Michael J. Salamone" <mikesa#at#entrek#dot#com>
- Date: Tue, 22 Nov 2005 20:12:36 -0800
Again, don't call GetLastError(). It is incorrect to do so, and the code it
returns does not relate to the call to SmsOpen.
Read the doc about SMS_E_RECEVEHANDLEALREADYOPEN. It says SmsOpen will
succeed the first time called in each process, so you open multiple times
from multiple processes. But only one time in each process. Since you are
a driver and presumably loaded into device.exe, it is possible that another
driver (an MS driver?) already called SmsOpen in that process. Subsequent
attempts to open would fail.
E_FAIL is a general error that is not at all informative. It means an error
occured, but it conveys no clue as to what the error is. It should be
banned from use (it should have never been invented). It's unbelievable to
me that it's still in use.
--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
"Avex" <Spammer@xxxxxxxxxxx> wrote in message
news:dm0jt7$ag7$2@xxxxxxxxxxxxxxxxxxxx
>
>> Sms messages are supposed to return HRESULTs, not Win32 error codes. Are
>> you getting E_NOTIMPL? If you are really getting
>> ERROR_CALL_NOT_IMPLEMENTED, are you getting it as a return code from
>> SmsOpen/SendMessage, or by calling GetLastError? If calling
>> GetLastError, you shouldn't be calling that.
>
> I work on 'Dopod 818' pocket pc phone which has SMS functions
> supported(sms.dll). On
> this device I wrote an SMS application, it runs well. However, the same
> SMS function I used cannot be run in my driver application.
>
> The error code SmsOpen gived is E_FAIL(80004005), I use GetLastError it
> returns ERROR_INVALID_HANDLE(6) and ERROR_CALL_NOT_IMPLEMENTED(120).
>
> What does it mean E_FAIL?
>
>> Are you getting SMS_E_RECEIVEHANDLEALREADYOPEN from SmsOpen? In
>> device.exe space, there may already be a driver that has it open. I
>> think the MS Sms receiver is in a different process, but I'm not certain
>> about that.
>
> No,
> Everytime I am going to try my driver, I tried a normal SMS application
> which I wrote to ensure that SMS is not occupied and close it before
> trying my driver.
>
> I just want to ensure that whether if I can use SMS functions in driver?
>
>
>
>
>
.
- Follow-Ups:
- Re: call SMS functions from driver
- From: Avex
- Re: call SMS functions from driver
- References:
- call SMS functions from driver
- From: Avex
- Re: call SMS functions from driver
- From: Michael J. Salamone
- Re: call SMS functions from driver
- From: Avex
- call SMS functions from driver
- Prev by Date: Re: Cannot rethrow C++ exceptions on Pocket PC?
- Next by Date: What function can instead the CeOpenDatabase() in VS2005!
- Previous by thread: Re: call SMS functions from driver
- Next by thread: Re: call SMS functions from driver
- Index(es):
Relevant Pages
|