Jens Thiel wrote:
"Edward Diener" <ed******@tropi csoft.com> wrote: I understand the syntax of custom attributes, but I have no idea
what they are supposed to do. Anyone care to give me a clue as to
their functionality ?
An attribute can add functionality or constraints to the attributed
"target". ManagedXLL for example provides a custom [WorksheetFuncti on]
attribute, that enables the the attributed method to be called from
Excel worksheets without modifying the method itself.
How does a custom attribute change usage of a particular type in MC++ ? Does
it direct the compiler to act differently ? That would seem to be impossible
since the compiler can not know about custom attributes. Does it allow the
programmer at run-time to react to a particular custom attribute by querying
the type for its attributes ? That would seem more probable but I am looking
for a practical example in MC++ code where this occurs.
In other words, let's say I create a custom attribute and use it for a
certain MC++ type. How practically would another programmer use my custom
attribute for added functionality when accessing an object of that type at
run-time ?