sheepfarmer
asked on
Adding a message loop in Delphi
I am looking to implement some sort of message or callback within a Delphi comms program.
I have a main form and a secondary form containing all the comms stuff.
I call a function on the comms form to send a comms request.
The comms form sends the message for me and has a receive event that collected the received information (which can take 5-10 seconds)
I need some method of the comms form letting the main form that something has been received on the comms port.
What would be an appropriate way to do this?
Thanks
SF
I have a main form and a secondary form containing all the comms stuff.
I call a function on the comms form to send a comms request.
The comms form sends the message for me and has a receive event that collected the received information (which can take 5-10 seconds)
I need some method of the comms form letting the main form that something has been received on the comms port.
What would be an appropriate way to do this?
Thanks
SF
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot.
SF
SF
ASKER
The comms form does have an event for 'data received' (using the ComPort library) so when that it's fired, I gather the data I need, then send a message to the main form.
What is the different between SendMessage and PostMessage (I am using the latter as I found that via separate research).
Also, I am using 0 for DataPointer and DataLength as I only need to know when there is data received (I collect the data from the comms form via a direct function call). Presumably its perfectly valid to just send
SendMessage(MainForm.Handl
Thanks
SF