Hi Guys:

I have searched in the forums and groups and I haven't find out why this is
happenning. Either I am missing some setting on my device or there is some
other way to code it. Here is my senario:

I am trying to write a serial bluetooth communication application on pocket
pc platform.
I have successfully opened ports and write to it.
In my attempt to check for error flags using ClearCommError that I p/invoked
from coredll.dll, pocket pc opens up a dialog form outside of my code that
reads:

"A native exception has occurred in dummyProgram.exe
select quit and restart this program or select details for more info"

Is there anyway I can get the error flags on the pocket pc? I am trying to
do this because I want to implement the auto baud functionality. I pretty
much has the auto baud algorithm but this dialog is driving me nuts.

Any help is appreciated. Thanks for reading.

--
"What if this is as good as it gets?"


Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-compact-framework/200508/1

RE: clearcommerror native exception? by a

a
Tue Aug 23 09:49:03 CDT 2005

This exception indicates that you're doing something wrong when passing the
managed memory. Why don't use the OpenNETCF.org's serial comm library?

http://www.opennetcf.org/sdf

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com | www.opennetcf.org


"ed via DotNetMonster.com" wrote:

> Hi Guys:
>
> I have searched in the forums and groups and I haven't find out why this is
> happenning. Either I am missing some setting on my device or there is some
> other way to code it. Here is my senario:
>
> I am trying to write a serial bluetooth communication application on pocket
> pc platform.
> I have successfully opened ports and write to it.
> In my attempt to check for error flags using ClearCommError that I p/invoked
> from coredll.dll, pocket pc opens up a dialog form outside of my code that
> reads:
>
> "A native exception has occurred in dummyProgram.exe
> select quit and restart this program or select details for more info"
>
> Is there anyway I can get the error flags on the pocket pc? I am trying to
> do this because I want to implement the auto baud functionality. I pretty
> much has the auto baud algorithm but this dialog is driving me nuts.
>
> Any help is appreciated. Thanks for reading.
>
> --
> "What if this is as good as it gets?"
>
>
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-compact-framework/200508/1
>
>

RE: clearcommerror native exception? by ed

ed
Tue Aug 23 11:08:44 CDT 2005

Thanks Alex.

Alex Yakhnin [MVP] wrote:
>This exception indicates that you're doing something wrong when passing the
>managed memory. Why don't use the OpenNETCF.org's serial comm library?
>
>http://www.opennetcf.org/sdf
>
>--
>Alex Yakhnin, .NET CF MVP
>www.intelliprog.com | www.opennetcf.org
>
>> Hi Guys:
>>
>[quoted text clipped - 17 lines]
>>
>> Any help is appreciated. Thanks for reading.

--
"What if this is as good as it gets?"


Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-compact-framework/200508/1


RE: clearcommerror native exception? by ed

ed
Tue Aug 23 14:04:17 CDT 2005

Hey Alex:

I tried openNetCf, it's pretty cool. I just have 1 more question. If I want
to change the port settings i.e. baud rate, parity and stopbit do I need to
re-open the port? My platform is pocket pc Axim.

So far it doesn't look like my settings are taking effect. Also, it's kind
of weird to me that the lpErrorCode returned by clearCommError is always 0 no
matter what baud I set it to. I don't think that should be the case. Does
that sound like I am doing something wrong?

Thank you very much.

Alex Yakhnin [MVP] wrote:
>This exception indicates that you're doing something wrong when passing the
>managed memory. Why don't use the OpenNETCF.org's serial comm library?
>
>http://www.opennetcf.org/sdf
>
>--
>Alex Yakhnin, .NET CF MVP
>www.intelliprog.com | www.opennetcf.org
>
>> Hi Guys:
>>
>[quoted text clipped - 17 lines]
>>
>> Any help is appreciated. Thanks for reading.

--
"What if this is as good as it gets?"


Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-compact-framework/200508/1


Re: clearcommerror native exception? by Dick

Dick
Wed Aug 24 10:10:55 CDT 2005

I am not sure about the Opennetcf.org serial object, you may have to close
and reopen the port to change speeds or other settings. I do this
automatically, on change, in my CFSerialIO dll (which you can download from
my homepage). Since the source code for the SDF is included, why not just
look there to see what happens?

As to your ClearCommError question... the errCode parameter is non-zero
when an error is captured by the Windows serial driver. These are
communications errors, so you would only see a non-zero value for something
like Framing, Overrun, Parity, etc.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.



Re: clearcommerror native exception? by Chris

Chris
Wed Aug 24 10:31:32 CDT 2005

IIRC early versions required a close/reopen, but I fixed it around the 1.2
release timeframe.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


"Dick Grier" <dick_grierNOSPAM@msn.com> wrote in message
news:uPqz33LqFHA.3664@TK2MSFTNGP10.phx.gbl...
>I am not sure about the Opennetcf.org serial object, you may have to close
>and reopen the port to change speeds or other settings. I do this
>automatically, on change, in my CFSerialIO dll (which you can download from
>my homepage). Since the source code for the SDF is included, why not just
>look there to see what happens?
>
> As to your ClearCommError question... the errCode parameter is non-zero
> when an error is captured by the Windows serial driver. These are
> communications errors, so you would only see a non-zero value for
> something like Framing, Overrun, Parity, etc.
>
> Dick
>
> --
> Richard Grier (Microsoft Visual Basic MVP)
>
> See www.hardandsoftware.net for contact information.
>
> Author of Visual Basic Programmer's Guide to Serial Communications, 4th
> Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
> www.mabry.com/vbpgser4 to order.
>
>



Re: clearcommerror native exception? by ed

ed
Thu Aug 25 16:18:26 CDT 2005

Hi Guy:

Thanks again for your posts.

I am trying to talk to several different pieces of hardware via pocket pc's
serial bluetooth. That's why I wanted to write an auto baud routine. some
of the hardware talks at 9600 while other talk in 19200 but for some reason,
when when I have used setupcomm to set up the baud to be 9600 on the 19200
hardware I don't get any error from ClearCommError. Here is a simpler look
at my setup:

'hooked up to 19200 baud hardware
createfile
get the dcb
set dcb for 9600 odd 8 1 '<- since BuildCommDCB is not support, the only way
I know how is to do:
DCB.Parity = 1
DCB.BaudRate = 9600
DCB.StopBits = 1
DCB.ByteSize = 8

'of course I instantiated the DCB.
setupComm
.
.
.
'sometime later
readfile <- the hw device continuesly outputs datavalues
'readfile succeeds or timesout either way some data is read
clearCommError(handle,errorFlag,null) <- errorFlag = 0

the data that I got is something like "????????????"
I thought it may have been parity error so I tried the setup for parity none,
odd, even, mark, and space.
but still I get "?????" setting it to 19200 also doesn't help.

This means there is something wrong with my settings but why didn't
clearCommError catch anything? So since I am getting a 0 it means that the
windows serial driver caught the error and handled it? Whether or not I have
the right setting doesn't seem to effect the errorFlag outcome. hmm.

1. Is there anyway to get the error flag short of writing a c lib and
p/invoke to it?
2. have you guys encounter the hair pulling teeth bitting "????" that just
doesn't care about your settings?

Thanks guys, for even reading this post.

Dick Grier wrote:
>I am not sure about the Opennetcf.org serial object, you may have to close
>and reopen the port to change speeds or other settings. I do this
>automatically, on change, in my CFSerialIO dll (which you can download from
>my homepage). Since the source code for the SDF is included, why not just
>look there to see what happens?
>
>As to your ClearCommError question... the errCode parameter is non-zero
>when an error is captured by the Windows serial driver. These are
>communications errors, so you would only see a non-zero value for something
>like Framing, Overrun, Parity, etc.
>
>Dick
>

--
"What if this is as good as it gets?"