Subj : Re: Trying to set up a Response table for a dervied thread class but not working... To : borland.public.cpp.borlandcpp From : Antsy Date : Fri Jun 04 2004 09:07 pm Consider the snippets below ..h file ------- .. .. ..class TFoo : public TWindow { protected: DECLARE_RESPONSE_TABLE(TFoo); } .. .. .. ..cpp file --------- .. .. .. DEFINE_RESPONSE_TABLE1(TFoo, TWindow) EV_MESSAGE(USMSG_FOO_EVENT, handleFOOEvent), END_RESPONSE_TABLE; .. .. .. ***OR*** On reading it appears that I can have any class and set it up like this and from my understanding it should be able to have events. Consider the snippets below ..h file ------- .. .. ..class TFoo : public TEventHandler{ protected: DECLARE_RESPONSE_TABLE(TFoo); } .. .. .. ..cpp file --------- .. .. .. DEFINE_RESPONSE_TABLE1(TFoo, TEventHandler EV_MESSAGE(USMSG_FOO_EVENT, handleFOOEvent), END_RESPONSE_TABLE; .. .. .. ***BUT*** what looks like is happening is that my main window is recieving the messgase but not any other class that i derive for TEventHandler or TWindow. Once I derive a classe from either of those should it not be able to recieve events directtly to their response tables? Or thats not how it works, and its the fact that messages only go to the main window of an app and you have to manually write code to send those messages you want to trap to the various other classes you have in your app. Whats happening with me is that my main window detects the messages...and then i have to manually foward them to other classes where as i would have prefered messages to be picked up directly by the classes. Do you know if thats possible ... for a class derived from Twindow or teventhandler to trap messages IF they are not the main window of the app. Thanks. " Bruce Salzman" wrote: >> Tell me something can only window classes like TWindow have response >tables that capture events and messages, if not how really can i >create a new class, and have it respond to events, messages via the >response table marcros. Because this is essentiall what I'm trying to >do. > >Yes, if you want to use the response table macros, you need a TWindow >somewhere in your class. I'm not sure what triggers your message, but >you can also send messages directly to a thread using >PostThreadMessage. > >Regards, >Bruce > > .