* krbyxtrm:
is there a way to 'manage' function execution using macros?
Yes.
#define MY_CALL_MACRO(MacroName)
Here endeth the macro definition.
{ g_MacroStack.push_back(MacroName);
<some code here...>}
Braces have no special meaning in macro definitions; they're just
braces, as usual.
However, here they're not even part of the definition.
such that when i use the macro like this:
MY_CALL_MACRO("MyMacroName")
{
Func1(123);
Func2(1);
Func3(1,123);
}
MY_CALL_MACRO("YetAnotherMacro")
{
Func2(1); // will be tagged with 1
Func3(1,123); // will be tagged with 2
}
I have a choice which Function in MyMacroName macro will be called,
functions inside the curly braces?
e.g.
CallFunctionByMacro(const char* szMacro, UINT function);
The question doesn't make sense.
It's possible that what you want is to perform one of n different
actions depending on a value determined at run time; for that you might
look up the command pattern.
If you'd like a more precise or directly useful answer please indicate
/what/ it is you'd like to achieve, in context, not the context free
/how/ details of some imaginary scheme to implement that effect.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?