views:

82

answers:

2

For some reason VS2008 adds a '_' prefix to the property names of the resources in the auto-generated Resource class.

I get this when I add multiple image files to the project using the "Add existing file" dialog.

How can I avoid this?

Google failed me, or, I might have failed google, either way, please help me! :)

A: 

VS seems to add underscore to file names with length less than three characters not counting the extension (".*") part.

That is, "a.png" would be prefixed as "_a.png" "abc.txt" wouldn't be prefixed.

But the original question remains, is there a way to control this auto-generated code behavior?

+1  A: 

The reason VS was adding an underscore prefix was that the file names of the resources I imported had purely numerical name part without the extension (ie. "1.bmp") and it's illegal to have a class or property name that begins with a number, thus it appends an underscore.

It is infact illegal for any identifier of any kind to start with a number in any C-derived language.
shoosh