Path: utzoo!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!mailrus!uunet!cs.dal.ca!aucs!880716a From: 880716a@aucs.uucp (Dave Astels) Newsgroups: comp.lang.c++ Subject: indirect message passing Message-ID: <1990May31.131937.25923@aucs.uucp> Date: 31 May 90 13:19:37 GMT Article-I.D.: aucs.1990May31.131937.25923 Organization: Acadia University - School of Computer Science Lines: 16 I am wondering if it is possible to pass messages in C++ indirectly. Let me explain: say I have a class X which has a member function foo(). Also, I have a variable y of type X. Rather than invoking y.foo() directly I want to store the information for later use. ie. I want to set up a callback (using X11 terminology).. to store the information that X::foo() is to be called for the object y, then do the call later (in response to some event, for example). I have done this in a UI I developed in Turbo Pascal 5.5. I have since bought Zortech C++, and wish to eventually rewrite the UI in C++. The technique in TP was implemented using generic pointers (to the object and the method entry point), and some assembly to do the actual method invocation (supplying the Self/this parameter, etc). -- - Dave Internet: 880716a@AcadiaU.CA Bitnet: 880716a@Acadia