Click here to Skip to main content
15,917,731 members
Home / Discussions / C#
   

C#

 
QuestionRe: Modal Dialog help in C# [modified] Pin
Martin#28-Jun-06 19:34
Martin#28-Jun-06 19:34 
AnswerRe: Modal Dialog help in C# Pin
Alexander Wiseman29-Jun-06 5:39
Alexander Wiseman29-Jun-06 5:39 
GeneralRe: Modal Dialog help in C# [modified] Pin
Martin#29-Jun-06 6:11
Martin#29-Jun-06 6:11 
GeneralRe: Modal Dialog help in C# Pin
Alexander Wiseman29-Jun-06 6:30
Alexander Wiseman29-Jun-06 6:30 
GeneralRe: Modal Dialog help in C# Pin
Martin#29-Jun-06 6:41
Martin#29-Jun-06 6:41 
GeneralRe: Modal Dialog help in C# Pin
McSmack29-Jun-06 6:00
McSmack29-Jun-06 6:00 
QuestionRe: Modal Dialog help in C# Pin
Alexander Wiseman29-Jun-06 6:41
Alexander Wiseman29-Jun-06 6:41 
AnswerRe: Modal Dialog help in C# Pin
McSmack29-Jun-06 7:17
McSmack29-Jun-06 7:17 
Thanks in advance for all your help.

One of the programmers here, created the serial DLL I am using. In that library he has a notify delegate which I subscribe to. His delegate has a couple of parameters which allows me to retrieve the data. Because I deal with a few different communication entities, I created a class which encapsulates the serial DLL, as well as some other specific comm stuff. In my class, I have

// Callback delegate that subscribers must implement

public delegate void DataReceivedHandler();

public event DataReceivedHandler OnDataReceived;


where OnDataReceived gets called inside my subscribed function with the serial library.

Sorry for the longwinded description. So the answer to one of your questions is that
once the library receives data, it creates a "notify" thread and calls my subscribed function which is in my comm class. The code is below

private void SerialConnection_PacketReceived(object sender, ReceivedPacket pkt)

{

// If anyone is subscribed to callback, notify them

if( OnDataReceived != null )

{

m_receivedPacket = pkt;

m_dataSizeReadIn = (int)m_receivedPacket.packet.Length;

Buffer.BlockCopy( m_receivedPacket.packet, 0, m_buffer, 0, m_dataSizeReadIn );

// Call Subscriber

OnDataReceived();

}

}




The serial class (which is also a form) is a member of my main form. The ShowDialogBox() resides in my Main Form. But I could easily move it to serial class. What do you think?

Regards,
McSmack
QuestionRe: Modal Dialog help in C# Pin
Alexander Wiseman29-Jun-06 10:53
Alexander Wiseman29-Jun-06 10:53 
AnswerRe: Modal Dialog help in C# Pin
McSmack29-Jun-06 12:19
McSmack29-Jun-06 12:19 
GeneralRe: Modal Dialog help in C# Pin
Alexander Wiseman29-Jun-06 12:54
Alexander Wiseman29-Jun-06 12:54 
QuestionQuick button question [modified] Pin
Arkon94828-Jun-06 13:05
Arkon94828-Jun-06 13:05 
AnswerRe: Quick button question [modified] Pin
Mike Poz28-Jun-06 13:45
Mike Poz28-Jun-06 13:45 
QuestionExporting to SPSS issue Pin
Nader Elshehabi28-Jun-06 11:59
Nader Elshehabi28-Jun-06 11:59 
AnswerRe: Exporting to SPSS issue Pin
farquem828-Jun-06 16:01
farquem828-Jun-06 16:01 
GeneralRe: Exporting to SPSS issue Pin
Nader Elshehabi28-Jun-06 17:29
Nader Elshehabi28-Jun-06 17:29 
QuestionASP.net and Javascript Pin
Naji.A28-Jun-06 11:27
Naji.A28-Jun-06 11:27 
AnswerRe: ASP.net and Javascript Pin
Guffa28-Jun-06 12:06
Guffa28-Jun-06 12:06 
GeneralAny helpful hints? Pin
Naji.A28-Jun-06 12:12
Naji.A28-Jun-06 12:12 
AnswerRe: Any helpful hints? Pin
Guffa28-Jun-06 19:31
Guffa28-Jun-06 19:31 
GeneralError Messages? [modified] Pin
Naji.A29-Jun-06 22:01
Naji.A29-Jun-06 22:01 
AnswerRe: Error Messages? Pin
Guffa30-Jun-06 5:25
Guffa30-Jun-06 5:25 
GeneralDon't see any error messages!!! [modified] Pin
Naji.A30-Jun-06 11:44
Naji.A30-Jun-06 11:44 
GeneralRe: Don't see any error messages!!! Pin
Guffa1-Jul-06 4:47
Guffa1-Jul-06 4:47 
GeneralNot Sure! Pin
Naji.A2-Jul-06 11:15
Naji.A2-Jul-06 11:15 

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.