Click here to Skip to main content
16,007,443 members
Home / Discussions / Mobile
   

Mobile

 
NewsWindows Marketplace for Mobile now open for app submissions Pin
brucedkyle28-Jul-09 7:12
brucedkyle28-Jul-09 7:12 
Questiontooltip control for win ce app Pin
obalesu28-Jul-09 0:11
obalesu28-Jul-09 0:11 
AnswerRe: tooltip control for win ce app Pin
HimanshuJoshi28-Jul-09 23:09
HimanshuJoshi28-Jul-09 23:09 
GeneralRe: tooltip control for win ce app Pin
obalesu29-Jul-09 3:49
obalesu29-Jul-09 3:49 
GeneralRe: tooltip control for win ce app Pin
HimanshuJoshi29-Jul-09 20:13
HimanshuJoshi29-Jul-09 20:13 
QuestionC# Rest web service and Android Client Pin
struja_ns28-Jul-09 0:03
struja_ns28-Jul-09 0:03 
AnswerRe: C# Rest web service and Android Client Pin
faheemsial2-Jun-10 22:01
faheemsial2-Jun-10 22:01 
QuestionRS232 Terminal Chat on Windows CE Emulator Pin
ChincoCodus26-Jul-09 21:47
ChincoCodus26-Jul-09 21:47 
Hello!
I’m writing an Application that I created in Visual C#. The application is
a Serial Com Terminal. I want this to run as a Windows CE Application in my device emulator. But it’s doesn’t really work. I don’t’ have any error but I can’t send other received any message from the serial port.
Can anyone please help me out in this?
Thanks in advance
Chinco


using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.IO;
using System.IO.Ports;

namespace MyCETerminalChat
{
public partial class Form1 : Form
{
string name;
string message;
StringComparer stringComparer = StringComparer.OrdinalIgnoreCase;



// Create a new SerialPort object with default settings.
SerialPort sp = new SerialPort();
public Form1()
{
InitializeComponent();
string[] ports = SerialPort.GetPortNames();

foreach (string port in ports)
{
cboPort.Items.Add(port);
}
}

private void cmdOpen_Click(object sender, EventArgs e)
{
try
{
sp = new SerialPort(cboPort.SelectedItem.ToString());
sp.BaudRate = int.Parse(cboBaud.SelectedItem.ToString());
// Set the read/write timeouts
sp.WriteTimeout = 500;
sp.ReadTimeout = 500;
sp.Parity = Parity.None;
sp.DataBits = 8;
sp.StopBits = StopBits.One;
sp.Handshake = Handshake.None;
sp.Open();




if (sp.IsOpen == true)
{
MessageBox.Show("Success");
cmdOpen.Enabled = false;
cmdClose.Enabled = true;
cmdSend.Enabled = true;




}
else

MessageBox.Show("Port no Connect");

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private void cmdSend_Click(object sender, EventArgs e)
{


string msg = txtSend.Text;
textBox1.Text += (msg);
sp.Write(msg);

txtSend.Text = "";



}

private void cmdClose_Click(object sender, EventArgs e)
{
sp.Close();
cmdOpen.Enabled = true;
cmdClose.Enabled = false;
cmdSend.Enabled = false;
}



delegate void ChangeTxtReciveTextDelegate(string newText);

private void ChangeTxtReciveText(string newText)
{
if (textBox1.InvokeRequired)
textBox1.Invoke(new ChangeTxtReciveTextDelegate(ChangeTxtReciveText), newText);
else
textBox1.Text = newText;
}

public void Read()
{


try
{
string message = sp.ReadExisting();
MessageBox.Show("Selected Item Text: " + message);

ChangeTxtReciveText(message);
}
catch (TimeoutException) { }
}

}
}
QuestionValues Does not fall within the expected range Pin
Sritanu _ Ghosh26-Jul-09 21:20
Sritanu _ Ghosh26-Jul-09 21:20 
AnswerRe: Values Does not fall within the expected range Pin
PavanPareta27-Jul-09 18:48
PavanPareta27-Jul-09 18:48 
GeneralRe: Values Does not fall within the expected range Pin
Sritanu _ Ghosh2-Aug-09 22:12
Sritanu _ Ghosh2-Aug-09 22:12 
QuestionComboBox column with DataGrid(windows mobile winforms) Pin
Avinash Tumulu24-Jul-09 3:27
Avinash Tumulu24-Jul-09 3:27 
Questionprintscreen in windows ce Pin
obalesu23-Jul-09 20:12
obalesu23-Jul-09 20:12 
AnswerRe: printscreen in windows ce Pin
nathanpc29-Jul-09 15:53
nathanpc29-Jul-09 15:53 
QuestionWindows Mobile Device with Webcams Plugged In Pin
henry00023-Jul-09 17:15
henry00023-Jul-09 17:15 
AnswerRe: Windows Mobile Device with Webcams Plugged In Pin
Joel Ivory Johnson27-Jul-09 14:32
professionalJoel Ivory Johnson27-Jul-09 14:32 
GeneralRe: Windows Mobile Device with Webcams Plugged In Pin
henry00030-Jul-09 19:02
henry00030-Jul-09 19:02 
GeneralRe: Windows Mobile Device with Webcams Plugged In Pin
Joel Ivory Johnson30-Jul-09 19:06
professionalJoel Ivory Johnson30-Jul-09 19:06 
QuestionHow to shutdown ppc by application? Pin
infsafe22-Jul-09 16:32
infsafe22-Jul-09 16:32 
QuestionHow to register a dll file in windows ce Pin
A.Ibrahim22-Jul-09 0:10
A.Ibrahim22-Jul-09 0:10 
AnswerRe: How to register a dll file in windows ce Pin
Bob Hall25-Aug-09 5:17
Bob Hall25-Aug-09 5:17 
QuestionHow to connect to Webservice through Windows-mobile using Param ? Pin
E_Gold17-Jul-09 22:47
E_Gold17-Jul-09 22:47 
QuestionCreating Excel Pin
sunil.n.cs16-Jul-09 20:18
sunil.n.cs16-Jul-09 20:18 
QuestionSquare Root Pin
Padmanabha_M15-Jul-09 19:51
Padmanabha_M15-Jul-09 19:51 
AnswerRe: Square Root Pin
mypicturefaded16-Jul-09 9:05
mypicturefaded16-Jul-09 9:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.