PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Grier`s CFSerial Control with wm5 and cf 2 sp1/2

Reply

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

 
Thread Tools Rate Thread
Old 22-06-2007, 09:06 PM   #1
Luke
Guest
 
Posts: n/a
Default Grier`s CFSerial Control with wm5 and cf 2 sp1/2


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.

  Reply With Quote
Old 23-06-2007, 07:07 PM   #2
Dick Grier
Guest
 
Posts: n/a
Default Re: Grier`s CFSerial Control with wm5 and cf 2 sp1/2

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 (dick_grier@msn.com)

--
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.


  Reply With Quote
Old 25-06-2007, 05:59 PM   #3
Javier Grijalba
Guest
 
Posts: n/a
Default Re: Grier`s CFSerial Control with wm5 and cf 2 sp1/2

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

On Sat, 23 Jun 2007 20:07:08 +0200, Dick Grier <dick_grierNOSPAM@.msn.com>
wrote:

> 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 (dick_grier@msn.com)
>




--
Javier Grijalba
www.contendosystems.com
Embedded Systems
J.Grijalba at Contendosystems dot com
  Reply With Quote
Old 25-06-2007, 06:59 PM   #4
Dick Grier
Guest
 
Posts: n/a
Default Re: Grier`s CFSerial Control with wm5 and cf 2 sp1/2

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.


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off