🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by JOLA Mon, 12 May 2003 09:48
event loop
#16511
Author: JOLA
Date: Mon, 12 May 2003 09:48
23 lines
1623 bytes
Hello!
I need to modify the event loop so that all the messages would be first send
to
"source" software
(which is software controlling scanner, delivered by
device developer )
to ensure that the "source" receives its messages.
If source doesn't process given message, it returns it to application to be
dispatched.

Question: would it be enough to place TApplicationEvents object in my app
and how to use it?
Or maybe it's better to put
while (GetMessage())
{
    send_message_to_source()
    and dispatch_it()   //if it was returned by source
}
loop somewhere in the app (but where? - I need it only when the source is
enabled, which happens not so often)?

Help please!
WETA
Re: event loop
#16527
Author: Remy Lebeau (TeamB)
Date: Mon, 12 May 2003 16:13
28 lines
1862 bytes
"JOLA" <weta@gazeta.pl> wrote in message
news:3ebf6e6e@newsgroups.borland.com...

> Question: would it be enough to place TApplicationEvents
> object in my app and how to use it?

Just assign an event handler to its OnMessage event, and set the Handled
parameter appropriately.

However, do keep in mind that OnMessage will only be triggered for messages
placed in the message queue, such as via PostMessage().  Not for messages
sent to a particular window directly via SendMessage().  Do you need to
intercept though as well?  If so, then you'll mst likely need to use a
message hook via SetWindowsHookEx() instead.

> Or maybe it's better to put
> while (GetMessage())
> {
>     send_message_to_source()
>     and dispatch_it()   //if it was returned by source
> }
> loop somewhere in the app

That is what the TApplication::OnMessage event already allows you to do.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads