Re: SerialPort vs. Port in OpenNetCF
- From: "Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 11:02:33 -0400
Thanks for the feedback, Tim. The CreateFile function which the class uses
internally does require the trailing colon for the port name in Windows CE.
The "\\." preceding the port is required on the desktop for addressing ports
> some number (9 maybe? I forget) so I imagine that's where that came from.
Ginny Caughey
..NET Compact Framework MVP
"Tim Johnson" <tjohnson@xxxxxxxxxxxxxx> wrote in message
news:uiiSr$ZqFHA.2624@xxxxxxxxxxxxxxxxxxxxxxx
>I had to modify the SerialPort class to get it to work, I wonder if others
>had the same problem:
>
> In the PortName property the set function created a name with this line of
> code:
>
> this.mPortName = "\\\\.\\" + value;
>
> So from an input name of "COM5:" it creates @"\\.\COM5:". This fails on
> the subsequent CreateFile. Note this is the Bluetooth virtual com port on
> some PDAs (others are COM7: or COM8:). Same thing when I exclude the
> colon ":" character.
>
> If I change that to simply:
> this.mPortName = value;
>
> and pass in "COM5:", it works fine.
> --
>
> Tim Johnson
> High Point Software, Inc.
> www.high-point.com
> (503) 312-8625
>
>
> "Ginny Caughey [MVP]" <ginny.caughey.online@xxxxxxxxxxxxxx> wrote in
> message news:OaN$1o3oFHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
>> Tim,
>>
>> The SerialPort class should work fine. Please let us know if you find
>> otherwise.
>>
>> Ginny Caughey
>> .NET Compact Framework MVP
>>
>> "Tim Johnson" <tjohnson@xxxxxxxxxxxxxx> wrote in message
>> news:%23qWCSg3oFHA.3036@xxxxxxxxxxxxxxxxxxxxxxx
>>> Is the SerialPort class in OpenNetCF fairly new? I'm assuming it's been
>>> developed to be sort of name-compatible with the new support in CF v2.0
>>> of the same name, to ease the upgrade, but that the Port class is still
>>> perfectly good.
>>>
>>> --
>>>
>>> Tim Johnson
>>> High Point Software, Inc.
>>> www.high-point.com
>>> (503) 312-8625
>>>
>>>
>>>
>>
>>
>
>
.
- Follow-Ups:
- Re: SerialPort vs. Port in OpenNetCF
- From: Tim Johnson
- Re: SerialPort vs. Port in OpenNetCF
- References:
- SerialPort vs. Port in OpenNetCF
- From: Tim Johnson
- Re: SerialPort vs. Port in OpenNetCF
- From: Ginny Caughey [MVP]
- Re: SerialPort vs. Port in OpenNetCF
- From: Tim Johnson
- SerialPort vs. Port in OpenNetCF
- Prev by Date: Re: multithreading problem
- Next by Date: Re: [C#] P/Invoke and void*
- Previous by thread: Re: SerialPort vs. Port in OpenNetCF
- Next by thread: Re: SerialPort vs. Port in OpenNetCF
- Index(es):
Relevant Pages
|