G
Guest
Hi,
Iam new to C#. Iam using Microsoft Visual Studio .Net 2003. Iam writing
a program to read the COM port in C# (Compact Framework). Iam planning to put
this code on a Windows CE OS image generated using WinCE Platform Builder
5.0.
Iam able to open the COM port using the function CreateFile (in
coredll.dll). The function returns a positive file handler. But when I try to
read the port using ReadFile, it does not read anything and the number of
Bytes read is 0. GetLastError and GetLastWin32Error gives 1400 - Invalid
window handle. Even ReadFile returns positive number
I read in one of the Microsoft Blog sites -
http://www.danielmoth.com/Blog/2004/09/serial-rs232-communications-in-net.html
"WinCE does not support overlapped io. Even the non-overlapped io is
implemented differently on the PC than on CE (e.g. Read/WriteFile do not
block on CE). Finally, the threading support of the CF is not as rich as that
of the full framework. Basically rs232 libraries designed for the
desktop/full framework will not just work on CE devices with the CF"
The author of this site gives option of using some custom library CFSerialIO
which didn't work either.
Other option the author gave was, to use OpenNETCF.IO.Serial which Iam
trying now (hope it works!)
System.IO.Ports is not supported in Visual Studio .Net 2003.
So if ReadFile is not for CE, then what else is an alternative?
One more question, Is there a COM2 in WinCE?
Please reply.
Iam new to C#. Iam using Microsoft Visual Studio .Net 2003. Iam writing
a program to read the COM port in C# (Compact Framework). Iam planning to put
this code on a Windows CE OS image generated using WinCE Platform Builder
5.0.
Iam able to open the COM port using the function CreateFile (in
coredll.dll). The function returns a positive file handler. But when I try to
read the port using ReadFile, it does not read anything and the number of
Bytes read is 0. GetLastError and GetLastWin32Error gives 1400 - Invalid
window handle. Even ReadFile returns positive number
I read in one of the Microsoft Blog sites -
http://www.danielmoth.com/Blog/2004/09/serial-rs232-communications-in-net.html
"WinCE does not support overlapped io. Even the non-overlapped io is
implemented differently on the PC than on CE (e.g. Read/WriteFile do not
block on CE). Finally, the threading support of the CF is not as rich as that
of the full framework. Basically rs232 libraries designed for the
desktop/full framework will not just work on CE devices with the CF"
The author of this site gives option of using some custom library CFSerialIO
which didn't work either.
Other option the author gave was, to use OpenNETCF.IO.Serial which Iam
trying now (hope it works!)
System.IO.Ports is not supported in Visual Studio .Net 2003.
So if ReadFile is not for CE, then what else is an alternative?
One more question, Is there a COM2 in WinCE?
Please reply.