Click here to Skip to main content
15,899,475 members
Home / Discussions / C#
   

C#

 
AnswerRe: GUI Form Exception when running C# form on Mono Pin
DigiOz Multimedia23-Nov-07 17:04
DigiOz Multimedia23-Nov-07 17:04 
Questiondynamically address class vairables [modified] Pin
shwaguy23-Nov-07 6:09
shwaguy23-Nov-07 6:09 
AnswerRe: dynamically address class vairables Pin
Mustafa Ismail Mustafa23-Nov-07 6:28
Mustafa Ismail Mustafa23-Nov-07 6:28 
AnswerRe: dynamically address class vairables Pin
Luc Pattyn23-Nov-07 6:35
sitebuilderLuc Pattyn23-Nov-07 6:35 
GeneralRe: dynamically address class vairables Pin
Mustafa Ismail Mustafa23-Nov-07 8:33
Mustafa Ismail Mustafa23-Nov-07 8:33 
GeneralRe: dynamically address class vairables Pin
Luc Pattyn23-Nov-07 8:57
sitebuilderLuc Pattyn23-Nov-07 8:57 
GeneralRe: dynamically address class vairables Pin
Mustafa Ismail Mustafa23-Nov-07 10:04
Mustafa Ismail Mustafa23-Nov-07 10:04 
QuestionSerialDataReceivedEventArgs does not fire Pin
stevenlberntsen23-Nov-07 5:55
stevenlberntsen23-Nov-07 5:55 
I have added a DataReceived event to COM3 (the IrDA port) on my PPC. However, this event is never fired. If I use a short Sleep function and then do a Read, the expected data is there. Does anyone have an idea of what is wrong here? My code follows.

public partial class Form1 : Form
{
private SerialPort m_gIrDA;
private Byte[] sendbuf;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
}

void m_gIrDA_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
MessageBox.Show("This never happens");
}

private void button1_Click(object sender, EventArgs e)
{
try
{
if (m_gIrDA != null)
{
m_gIrDA.Close();
}
m_gIrDA = new SerialPort("COM3", // string portName,
57600, // baudRate
Parity.None,
8, // int dataBits,
StopBits.One);
m_gIrDA.Handshake = Handshake.RequestToSend;
m_gIrDA.ReceivedBytesThreshold = 3;
m_gIrDA.DataReceived += new SerialDataReceivedEventHandler(m_gIrDA_DataReceived);
m_gIrDA.DtrEnable = true;
m_gIrDA.Handshake = Handshake.RequestToSend;
m_gIrDA.Open();
sendbuf = new byte[10];
sendbuf[0] = 0x0a;
sendbuf[1] = 0x00;
sendbuf[2] = 0x01;
sendbuf[3] = 0x20;
sendbuf[4] = 0x35;
sendbuf[5] = 0x38;
sendbuf[6] = 0x30;
sendbuf[7] = 0x30;
sendbuf[8] = 0xf9;
sendbuf[9] = 0xec;
m_gIrDA.Write(sendbuf, 0, 10);
}
catch (System.IO.IOException)
{
m_gIrDA.Close();
MessageBox.Show("IOException");
}
}
}


Steven L Berntsen
Montreal QC Canada
sberntsen@kim.kaba.com
QuestionDB Table Exsits Pin
half-life23-Nov-07 5:48
half-life23-Nov-07 5:48 
AnswerRe: DB Table Exsits Pin
SABhatti23-Nov-07 11:56
SABhatti23-Nov-07 11:56 
GeneralRe: DB Table Exsits Pin
half-life24-Nov-07 0:52
half-life24-Nov-07 0:52 
QuestionNotifyIcon Click Problem Pin
Sukhjinder_K23-Nov-07 5:48
Sukhjinder_K23-Nov-07 5:48 
AnswerRe: NotifyIcon Click Problem Pin
DaveyM6923-Nov-07 8:21
professionalDaveyM6923-Nov-07 8:21 
Questioncombo+sql+C# Pin
sajid.salim.khan23-Nov-07 4:50
sajid.salim.khan23-Nov-07 4:50 
AnswerWhy did you repost your message? Pin
pmarfleet23-Nov-07 5:46
pmarfleet23-Nov-07 5:46 
AnswerRe: combo+sql+C# Pin
Paul Conrad23-Nov-07 7:38
professionalPaul Conrad23-Nov-07 7:38 
Questionstore procedure problem [modified] Pin
Raza Hussain23-Nov-07 4:50
Raza Hussain23-Nov-07 4:50 
AnswerRe: store procedure problem Pin
Rob Philpott23-Nov-07 5:27
Rob Philpott23-Nov-07 5:27 
QuestionSql Table Foriegn Key Problem in C# Pin
sajid.salim.khan23-Nov-07 4:47
sajid.salim.khan23-Nov-07 4:47 
AnswerRe: Sql Table Foriegn Key Problem in C# Pin
Raza Hussain23-Nov-07 5:00
Raza Hussain23-Nov-07 5:00 
Questionhow can I shutdown the pc ? Pin
The Glory23-Nov-07 4:38
The Glory23-Nov-07 4:38 
AnswerRe: how can I shutdown the pc ? Pin
Kristian Sixhøj23-Nov-07 4:49
Kristian Sixhøj23-Nov-07 4:49 
AnswerRe: how can I shutdown the pc ? Pin
Anthony Mushrow23-Nov-07 5:56
professionalAnthony Mushrow23-Nov-07 5:56 
QuestionDeleting row in Event Pin
baerten23-Nov-07 4:20
baerten23-Nov-07 4:20 
QuestionLoad an image from a file Pin
SeeBees23-Nov-07 3:50
SeeBees23-Nov-07 3:50 

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.