Board index » delphi » event won't happen

event won't happen

Hello all,
 I'm struggling here.  If anyone could help, please do.
I've set up some routines with a rs-232 comm component, where I have it follow
a specified sequence of sending and receiving.
What I'm trying to do here is create a seperate unit (call it "UNIT2") and
place all the routines in it, so I can create different projects and include
UNIT2 in each project.
Here's what I've got so far:

unit UNIT2;

interface
uses  
windows, messages, sysutils, classes, graphics, controls, forms, dialogs,
stdctrls, extctrls;

implementation
  uses Tcomport;  (component)

type

var
FComm: Tcomport;

procedure FCommReceiveData(Sender: TObject;DataPtr: Pointer; DataSize:
Integer);
begin
...(routine to process received data)
end;

initialization
fcomm:=Tcomport.Create(fcomm);
fcomm.ComPort:=pnCom1;            //set port #
fcomm.ComPortSpeed:=br9600;     //set baud rate
fcomm.ComPortParity:=ptNONE;   //set parity
end.

When data comes in, the routine for receiving data doesn't execute.
I don't know what I'm missing.
Maybe I didn't call the create right.
It expects an (AOwner: Tcomponent) when I type it in.
I'm pretty lost here.
Thanks for hearing me out,
-Ben

 

Re:event won't happen


Quote
Pootrpootr wrote:
>  I'm struggling here.  If anyone could help, please do.
> I've set up some routines with a rs-232 comm component, where I have it follow
> a specified sequence of sending and receiving.
> What I'm trying to do here is create a seperate unit (call it "UNIT2")

.... snipped

http://www.geocities.com/SiliconValley/2926/tp.html
chapter "serial", article "AuxUnit"

Franz Glaser

Other Threads