Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the TIMESTAMP Predefined Macro

Status
Not open for further replies.

thiefmaster

Programmer
Jan 27, 2001
22
0
0
US
Hello. I'm having a problem with the TIMESTAMP Predefined Macro. Perhaps it's just not what I need to use, but I'll find out.

I want to make it so my program has the date and time of build encoded in it in such a way that my program can view this information in the about box. eg. About my program. Built on Saturday 27, 2001 at 1:00 am.

I've tried using TIMESTAMP, but it doesn't work right... I'm just getting errors. Is this the way to do it, or is there a better way to do this? I'm writing this program using Win32 API and NOT MFC...

Thanks in advance for any help.
 
I have re-read your post several times and it is unclear to me want you want to accomplish.

> so my program has the date and time of build
> my program can view this information in the about box

The date and time of the 'build' is in effect the date and time of the resulting .exe file.

> I'm having a problem with the TIMESTAMP Predefined Macro.

First it is __TIMESTAMP__ not TIMESTAMP

Next, it's use is that it supplies the date and time of the source code files last modification. That is not the same as the 'build' of the project.

> I'm just getting errors

I can't determine the source of your errors without seeing error messages and their associated code.

> Is this the way to do it, or is there a better way to do this?

Do what... exactly? Here is how you use __TIMESTAMP__

cout << &quot;Source file timestamp: &quot; << __TIMESTAMP__ << endl;

Hope this helps
-pete

 
I'm pretty sure i've got the problem licked now... Like you said, I needed to take the date of the EXE file rather than doing it any other way...
 
You might also want to take a look at the VerInfo structure, and the versioning API calls.

These allow you to examine an executable file and read the version stamp the resource compiler put in there.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top