<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Windows Embeded CE 6.0' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Windows Embeded CE 6.0' posted on the 'C#' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Tue, 18 Jun 2013 19:28:32 -0700</pubDate>
    <lastBuildDate>Tue, 18 Jun 2013 19:28:32 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Windows Embeded CE 6.0</title>
      <link>http://www.programmersheaven.com/mb/csharp/431185/431185/windows-embeded-ce-60/</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
I'm new to programming for Windows CE. I have made a simple application that open up a COM port and it's supposed to receive commands. The port is setup as a loopback for testing right now. It runs fine in Windows 7 Machine, but when I try to run the .exe on the Windows CE platform it spits out a few errors when it tries to open up the com port.&lt;br /&gt;
&lt;br /&gt;
I wrote the application with C# in Visual Studio Pro 2005. If someone can give me a hint I'll appreciate it. I build as a Windows CE 5.0 Device on the IDE.&lt;br /&gt;
&lt;br /&gt;
Below is my code in C#:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;using System;
using System.IO.Ports;

namespace COMTest
{
    public class Program
    {
        static bool _continue;
        static SerialPort _sPort;

        public static void Main(string[] args)
        {
            string _portList;
            
            //Configure the COM Port
            _sPort = new SerialPort();
            _sPort.PortName = "COM2";
            _sPort.BaudRate = int.Parse("9600");
            _sPort.Parity = (Parity.None);
            _sPort.DataBits = int.Parse("8");
            _sPort.StopBits = (StopBits.One);

            _sPort.ReadTimeout = 500;
            _sPort.WriteTimeout = 500;

            _portList = SetPortName("COM2"); //Check for availaable COM Ports and lists them.
            
            _sPort.Open();
            _continue = true;

            //tesString = Console.ReadLine();
            _sPort.WriteLine("COM PORT TEST");
            _sPort.WriteLine("Type String to LoopBack");

            Read();
            _sPort.Close();
        }

        public static void Read()
        {
            while (_continue)
            {
                try
                {
                    string message = _sPort.ReadLine();
                    Console.WriteLine(message);
                }
                catch (TimeoutException) { }
            }
        }

        public static string SetPortName(string defaultPortName)
        {
            string portName;

            Console.WriteLine("Available Ports:");
            foreach (string s in SerialPort.GetPortNames())
            {
                Console.WriteLine("   {0}", s);
            }

            Console.Write("COM port({0}): ", defaultPortName);
            portName = Console.ReadLine();

            if (portName == "")
            {
                portName = defaultPortName;
            }
            return portName;
        }
    }
}

&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/431185/431185/windows-embeded-ce-60/</guid>
      <pubDate>Mon, 04 Feb 2013 09:17:24 -0700</pubDate>
      <category>C#</category>
    </item>
  </channel>
</rss>