
Feature request: Get attribute info in code
Hi,
Quote:
> Attributed code is nice to make your code look cleaner and also makes it
> possible to keep everything in one place instead of having to look in 3
> different files.
> However there is no way to get an attribute of an object in the code. For
> example I would like to get the name of the helpfile from the module
> attributes. I could specify my module as follows:
> [ module(EXE, uuid = "{just another GUID}",
> name = "MyModule",
> helpstring = "My Company My Module Definition",
> helpfile="MyHelpFile.hlp",
> resource_name = "IDR_MYMODULE") ];
> Now in my code I generate an error so I use the Error method to set the
> error code. In one of the overloaded Error methods I can specify the
> helpfile name so I want to pass my helpfile. Now I have to copy the name
of
> the helpfile. It would be nice if I could do something like
> [module.attributes.helpfile] or [module.helpfile].
> If this is not possible how about adding it to the Module base class to
get
> the helpfilename.
> I know you guys of Microsoft can come up with the best solution for this.
Have a look at your project settings. There is one option to output the
attributed code in a file called <filename>.mgr.h where <filename> is one of
your header files where you used attributes in. You can look at the
generated code to get a clue where the attribute information went.
I really would guess that the help file information is available from some
ATL class...
Bye,
Sven