Grier`s CFSerial Control with wm5 and cf 2 sp1/2

L

Luke

Hello,

i have following problem: I use Grier´s SerialClass in my application
for serial communication. This all works fine with wm 5 cf 2 without
any service pack on it. If i update cf 2 to sp1 or sp2 i get an native
exception by opening serial port.
The exception is: 0xc0000005.

Does anybody know how to solve this problem?

Thanks.
 
D

Dick Grier

Hi,

Yes. The SP1 and SP2 for CF2 introduce a bug (meant to solve a problem for
Windows Mobile 6 devices) in the ReadFile API. I have re-written the dll,
and it works fairly reliably (contact be by email to get a copy for
testing). There still is a possible failure-mode when the port is disposed.
I haven't seen it, but I don't doubt that it might occur (I don't have a
solution for that potential exception right now). You can help me test this
new version on your devices, if you are willing.

Dick ([email protected])

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
J

Javier Grijalba

Hi Dick,
can you send me link that describes the bug in the ReadfileAPI ?
Is this bug solved in the latest QFE of the Platform Builder WInCE 5.0?
Regards
Javier
 
D

Dick Grier

Hi,

AFAIK, there is no link.

If you call ReadFile (with a valid handle) AND if there is no data to
receive, the exception is generated. This exception is not trappable, and
it is a "new feature" with SP1/SP2. I have reported it to Microsoft (and
have given them a source code example), but have not seen anything new since
then (March). So, the only solution, to date, is to call the SetCommMask
and WaitCommState APIs, then to read data via ReadFile only when the
WaitCommState callback for receive data is generated. While this works,
there are some non-trivial problems that are associated with this technique
that I have not yet had time to fully explore.

BTW, in prior versions of WinCE (with and without the Compact Framework),
you could call ReadFile -- whether or not there was data to receive. Of no
data, then ReadFile returned an empty buffer, with a count of zero. That
has changed.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top