Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

Version Editor in Developer Studio 5 -> Compilation Date

Developer Studio 5's help claims: "Version information consists of company and product identification, a product release number, and copyright and trademark notification.". I want to have compilation date as well.
In MSVC 1.52 I could simply have a row like this in a BLOCK:
VALUE "Compilation Date", __DATE__ ", " __TIME__ "\0"

When I use the same .rc in a Developer Studio project I get:
error RC2104 : undefined keyword or key name: __DATE__

Please advise.
0
gilg
Asked:
gilg
1 Solution
 
dabblerCommented:
It appears that your .RC file isn't being preprocessed before being resource compiled.
0
 
gilgAuthor Commented:
How can I make it be preprocessed????

0
 
RONSLOWCommented:
Are you getting this information when opening the resource for editing? or when compiling resources? or ...?


0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
gilgAuthor Commented:
I get the problem when trying to compile a .rc created via VC++ 1.52. If I open it in Developer Studio 5, it gets corrupted, but if I edit it from anywhere else and comments out the problematic row I can use it asis in the Studio.
0
 
dew_associatesCommented:
Gilg: The problem in Developer Studio is that the keyword "Date" is an undefined keyword or key name, eg:
      MFT_STRING

You need to first define the keyword before you can use it!
0
 
gilgAuthor Commented:
Sorry, didn't quite grasp that. How do I define the __DATE__ keyword so that the resource compiler (or some sort of preprocessor) will know he should replace it by compilation date?
0
 
gilgAuthor Commented:
Adjusted points to 85
0
 
dew_associatesCommented:
Gilg: The variables are usually created in Visual C or J and then Developers Studio is used to run the project.
0
 
dew_associatesCommented:
In essence, decompile the project item your trying to change, whether in J or C, create the additional variable, recompile it and run it in developers studio as before.
0
 
gilgAuthor Commented:
I'm still not with you, I'm not trying to change any project item. I have a resource file (.rc) created and succesfuly compiled under VC++ 1.52 and I am trying to add it as is (the source) to a Developer Studio 5 project. The __DATE__ symbol was in VC++ 1.52 a predefined symbol substituted to the current compilation date and it is so also in the Studio (I can look it up in the Help and what more, I can use it in a .cpp file. It seems more likely that my .rc isn't being preprocessed and I want to know how to make it be.
0
 
dew_associatesCommented:
Gilg: Your trying to take a shortcut. Your words: "I get the problem when trying to compile a .rc created via VC++ 1.52. If I open it in Developer Studio 5, it gets corrupted, but if I edit it from anywhere else and comments out the problematic row I can use it asis in the Studio. "  and " The __DATE__ symbol was in VC++ 1.52 a predefined symbol substituted to the current compilation date and it is so also in the Studio (I can look it up in the Help and what more, I can use it in a .cpp file." Okay, from a developers standpoint, which is it, a file that becomes corrupted in Developers Studio or one that works. If it's being correupted, then there's either something wrong with the file or with the install of Developers Studio! If you are getting, "error RC2104 : undefined keyword or key name: __DATE__" and you know that the keyword has been defined, then the file itself is corrupted. Therefore, we are back to the original answer, uncompile the file or replace it with a known good one that has the keyword present.
0
 
gilgAuthor Commented:
Well, I'm quite new to the studio (and to PC programming). How can I uncompile a .rc? The Studio doesn't let me textually edit the Version info, I get a list of keys and values and I can update the values but I can't add a new pair. What I need to do, and it doesn't seem much to me, is add compilation date to the version info.
Now, maybe this is a new question and I would very much like to grade you for your efforts so far. If you'll just tell me how it's done.
0
 
dew_associatesCommented:
Gilg: Microsoft (I believe) makes available a developers kit for Visual C++ and for Visual J. If I were you, and given that what you want has been compiled in C++, download the kit for visual C++ and decompile the resource file. Make the additions for what you need and then recompile it. You should then be able to run the studio as you need too!  Make sure though that you have a good copy of the file you want to decompile and change. I say this only because of the errors you have received.
Both "C" and :J" are available on Microsoft's site.
0
 
dew_associatesCommented:
Let me know how you make out!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now