<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=906284003-24112004><FONT face=Arial color=#0000ff
size=2>Actually just thinking about it, I COULD create a class thats main
function is to (1). Create the comm control, and setup its properties, and
(2).that has the event that triggers when there is data, which would be assigned
to a procedure internally to the class.</FONT></SPAN></DIV>
<DIV><SPAN class=906284003-24112004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=906284003-24112004><FONT face=Arial color=#0000ff size=2>The
idea being, that you would say have 5 comports that you need to
monitor.</FONT></SPAN></DIV>
<DIV><SPAN class=906284003-24112004><FONT face=Arial color=#0000ff size=2>Then,
create a class for each comport (in this case 5) dynamically, and the class
passes the data it receives to a function/procedure in the parent of the class
which would be a form.</FONT></SPAN></DIV>
<DIV><SPAN class=906284003-24112004></SPAN><SPAN class=906284003-24112004><FONT
face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=906284003-24112004><FONT face=Arial color=#0000ff size=2>Does
this sound feasible?</FONT></SPAN></DIV>
<DIV><SPAN class=906284003-24112004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=906284003-24112004><FONT face=Arial color=#0000ff
size=2>Jeremy</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
delphi-bounces@ns3.123.co.nz [mailto:delphi-bounces@ns3.123.co.nz] <B>On
Behalf Of </B>Matt Comb<BR><B>Sent:</B> Wednesday, 24 November 2004
10:25<BR><B>To:</B> NZ Borland Developers Group - Delphi
List<BR><B>Subject:</B> Re: [DUG] Multiple com ports<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hi Jeremy, I would probably create a listener
thread which has your data processing routine in it or assigned to it, and
spawn it however many times you require.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt.</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=vss@vss.co.nz href="mailto:vss@vss.co.nz">Jeremy Coulter</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@delphi.org.nz
href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, November 24, 2004 9:58
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [DUG] Multiple com ports</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>HI
all.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>I have a
situation where I may need to have multiple comports monitored in an
app.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>The number
comports could be from 1 (most common) to 4 to 8 or however
many.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>I think I would
want to limit the number at some stage to say 8, but this is yet to be
decided.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>Anyway, I can
dynamically create the comports and set their properties etc, thats ok, BUT
the problem I forsee is, when it comes to receiving
data.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>ATM I use Async
Pro created on the form, and have the event to handle the data coming in
created and assigned etc.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>If I dynamically
create a control I prob. cant really assign the event to the same event at
the control that is created on the form, as it will prob. get data mixed up
etc.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>So, what would
be the best way to handle this?</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>I guess I could
create 8 event handlers, but thats not exactly ideal.</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>Anyone got any
ideas?</FONT></SPAN></DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=968515020-23112004><FONT face=Arial size=2>Thanks,
Jeremy</FONT></SPAN></SPAN></DIV></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Delphi mailing
list<BR>Delphi@ns3.123.co.nz<BR>http://ns3.123.co.nz/mailman/listinfo/delphi<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>