iceColdFire said:
Hi John.,
Indeed your interpretation is ture...
I didn't give an interpretation, I asked questions. I didn't get a lot of
answers.
But somehow I am ttrying to use function calls inside other functions
such that the call code is not visible to the programmer...
If you are talking about doing this in a program's source code, then it
might be possible with some sort of macro trickery but that would depend on
the specific details. Macro trickery is fairly commonly used in order to log
dynamic memory allocation and deletion. If you want to affect a running
program, then that is platform specific (and could be either easy or very
hard depending on the details).
some way should exist...is there any way to know that a particular
function has been called without using explicit flags or
vriables...Maybe this logic works..
The Windows operating system provides built-in support for what is called
"sub-classing". Each window type (misleadingly called "class") has
associated with it a "window procedure" for processing messages to the
window. You can however replace this window procedure with a function of
your own and, within your own function, call the original function. This
makes it possible to in effect add processing (logging, for example) to the
original function without the function's knowledge. Windows also has built
in support for what are called "hooks" which allow for the monitoring of
messages and other stuff. You can execute your own functions conditional on
what is intercepted. For working with Windows functions more generally,
there are other more advanced techniques. I have never used it, but the
Detours library is useful for some of this stuff.
http://research.microsoft.com/sn/detours/
In any event, to get further guidance, you will need to be very specific
about what you want to accomplish and, unless you are after an internal
source code solution, ask in newsgroups dedicated to the platforms of
interest.