Feature request: Get attribute info in code 
Author Message
 Feature request: Get attribute info in code

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.

Edwin



Tue, 07 Sep 2004 18:52:33 GMT  
 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



Wed, 08 Sep 2004 04:00:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Source Code Analyzer: Info requested

2. Code Analysis Tools Info Request

3. Attributed and non-attributed code performance

4. Debugger feature request: Not step into included functions

5. New C# Language Feature Request

6. new Perl feature request: call into shared libs

7. C and C++ together. (structure feature request)

8. Compiler feature request

9. FEATURE REQUEST TO MS: public CString::FormatV

10. feature request

11. Feature request: parameterized types.

12. Feature request: delete keyword

 

 
Powered by phpBB® Forum Software