L
lsheung
Hi,
My test program is as simple as the following. When I
deploy it as a Pocket PC 2002 application, I got a CommPortException.
Any advice on how to acheive it?
Lok
A managed CommPortException
occurred at Application::Run+0x1a
CreateFile Failed: 55
Application::Run+0x1a
MainForm::Main+0x27
using System;
using System.Data;
using OpenNETCF.IO.Serial;
namespace SmartDeviceApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
private Port port;
private string portName;
private BasicPortSettings portSetting = new BasicPortSettings();
public Class1(string portName)
{
portSetting.BaudRate = BaudRates.CBR_9600;
portSetting.Parity = Parity.none;
portSetting.ByteSize = 8;
portSetting.StopBits = StopBits.one;
this.portName = portName;
port = new Port(portName, portSetting);
//port = new Port(portName, BaudRates.CBR_9600, Parity.none, 8,
StopBits.one);
}
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
string portName = "COM4:";
Class1 tester;
tester = new Class1(portName);
tester.port.Open();
tester.port.Close();
}
}
}
My test program is as simple as the following. When I
deploy it as a Pocket PC 2002 application, I got a CommPortException.
Any advice on how to acheive it?
Lok
A managed CommPortException
occurred at Application::Run+0x1a
CreateFile Failed: 55
Application::Run+0x1a
MainForm::Main+0x27
using System;
using System.Data;
using OpenNETCF.IO.Serial;
namespace SmartDeviceApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
private Port port;
private string portName;
private BasicPortSettings portSetting = new BasicPortSettings();
public Class1(string portName)
{
portSetting.BaudRate = BaudRates.CBR_9600;
portSetting.Parity = Parity.none;
portSetting.ByteSize = 8;
portSetting.StopBits = StopBits.one;
this.portName = portName;
port = new Port(portName, portSetting);
//port = new Port(portName, BaudRates.CBR_9600, Parity.none, 8,
StopBits.one);
}
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
string portName = "COM4:";
Class1 tester;
tester = new Class1(portName);
tester.port.Open();
tester.port.Close();
}
}
}