Click here to Skip to main content
15,923,218 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Fixed variables and the GC Pin
Andy Brummer13-Sep-05 17:35
sitebuilderAndy Brummer13-Sep-05 17:35 
AnswerRe: Fixed variables and the GC Pin
S. Senthil Kumar16-Sep-05 6:02
S. Senthil Kumar16-Sep-05 6:02 
GeneralRe: Fixed variables and the GC Pin
Dan Neely16-Sep-05 7:52
Dan Neely16-Sep-05 7:52 
GeneralRe: Fixed variables and the GC Pin
Dave Kreskowiak16-Sep-05 9:16
mveDave Kreskowiak16-Sep-05 9:16 
QuestionHELP: How to create and register channels in new application domain Pin
SongDog13-Sep-05 6:06
SongDog13-Sep-05 6:06 
Questionhelp me Pin
Anonymous13-Sep-05 3:45
Anonymous13-Sep-05 3:45 
AnswerRe: help me Pin
Christian Graus13-Sep-05 14:31
protectorChristian Graus13-Sep-05 14:31 
QuestionCompact Framework strange exception Pin
David Menéndez Cisterna13-Sep-05 2:24
David Menéndez Cisterna13-Sep-05 2:24 
I've developed a simple C# program (for PocketPC), and It sometimes crashes with an unhandled exception... and I thing it is related to UI matters. The message is this:

Exception
Application::Run+0xf
Form1::Main+0xa

Mi application read info from serial port (from a GPS), with this event handler:

private void OnDataReceived(object sender, SerialDataReceivedEventArgs e) <br />
{ <br />
while(port != null && port.BytesToRead > 0) <br />
{ <br />
int Cnt = port.Read(portBuf, portPos, 1); <br />
<br />
if (Cnt != 0) <br />
{ <br />
//Read from input buffer <br />
if (portBuf[portPos] == '\n') <br />
{ <br />
string sentence = Encoding.ASCII.GetString(portBuf, 0, portPos-1); <br />
AddResult(sentence); <br />
<br />
portPos = 0; <br />
} <br />
else <br />
{ <br />
portPos++; <br />
} <br />
} <br />
} // while <br />
} <br />
<br />


After much investigation, now I am able to cause that exception by clicking a button. The code is this, simple one:

<br />
private void btnClosePort_Click(object sender, System.EventArgs e) <br />
{ <br />
Cursor.Current = Cursors.WaitCursor; <br />
<br />
// Wait for things to settle <br />
Thread.Sleep(1000); <br />
<br />
try <br />
{ <br />
  port.DataReceived -= new SerialDataReceivedEventHandler(OnDataReceived); <br />
  // Wait <br />
Thread.Sleep(1000); <br />
<br />
  port.Close(); <br />
  port.Dispose(); <br />
  port = null; <br />
} <br />
catch (Exception ex) <br />
{ <br />
  AddResult("-->Failure"); <br />
  AddResult(ex.ToString()); <br />
} <br />
<br />
Cursor.Current = Cursors.Default; <br />
<br />
AddResult("-->Closed"); <br />
}<br />


Notes: AddResult simple does add strings into a ListBox.

The really strange thing is this: if I remove the AddResult(sentence) call in "OnDataReceive", the exception is not thrown.

Could it be any bug related to UI ?
My hardware: iPAQ 2100 , Windows Mobile 2003 SE

Hope you can help me Smile | :)

Thanks to all!
Questionshortcut and InputLanguage Pin
Anonymous12-Sep-05 21:33
Anonymous12-Sep-05 21:33 
QuestionHow to create different IPC channels in both server and client configuration files Pin
SongDog12-Sep-05 19:13
SongDog12-Sep-05 19:13 
Questioninstaller of c#.net project Pin
AvinashKundal12-Sep-05 19:12
AvinashKundal12-Sep-05 19:12 
AnswerRe: installer of c#.net project Pin
rwestgraham13-Sep-05 9:04
rwestgraham13-Sep-05 9:04 
QuestionFound incredible notepad like source editor Pin
Heinz_9-Sep-05 17:24
Heinz_9-Sep-05 17:24 
QuestionOne inherited form from FormBase has one toolbar and one imagelist Pin
Emerson Valente9-Sep-05 2:59
Emerson Valente9-Sep-05 2:59 
AnswerRe: Funcionamento de Toolbar publica em Form herdado Pin
Dave Kreskowiak9-Sep-05 4:31
mveDave Kreskowiak9-Sep-05 4:31 
QuestionVB.net ListView Flicker Pin
Gate Crasher8-Sep-05 16:29
Gate Crasher8-Sep-05 16:29 
AnswerRe: VB.net ListView Flicker Pin
Christian Graus8-Sep-05 16:43
protectorChristian Graus8-Sep-05 16:43 
GeneralRe: VB.net ListView Flicker Pin
[Marc]10-Sep-05 0:28
[Marc]10-Sep-05 0:28 
AnswerRe: VB.net ListView Flicker Pin
S. Senthil Kumar16-Sep-05 6:14
S. Senthil Kumar16-Sep-05 6:14 
QuestionBeginner Help Pin
Anonymous8-Sep-05 9:38
Anonymous8-Sep-05 9:38 
AnswerRe: Beginner Help Pin
Colin Angus Mackay8-Sep-05 11:01
Colin Angus Mackay8-Sep-05 11:01 
Questionpopup control ruined my app Pin
texasjames8-Sep-05 9:05
texasjames8-Sep-05 9:05 
AnswerRe: popup control ruined my app Pin
Colin Angus Mackay9-Sep-05 5:57
Colin Angus Mackay9-Sep-05 5:57 
Question.Net C# Word Add-in install Pin
tartancli8-Sep-05 8:19
tartancli8-Sep-05 8:19 
AnswerRe: .Net C# Word Add-in install Pin
rwestgraham11-Sep-05 11:18
rwestgraham11-Sep-05 11:18 

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.