"Alan Ingleby" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Ron Nicholson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Thu, 20 Nov 2003 12:03:42Gregg Woodcock writes:
> > >P.S. How do all you programmers handle the creation/compile/release
date
> in
> > >your apps? Do you use a string resource in the RSC? Do you have a
good
> way
> > >to auto-populate this or do you just manually set it before the last
> compile
> > >prior to release?
>
> In resource file:
>
> VERSION ID 1000 "0.1"
>
> ALERT ID AboutAlert HELPID 1001 DEFAULTBUTTON 0 INFORMATION
> BEGIN
> TITLE "About"
> MESSAGE "Version ^1"
> BUTTONS "OK"
> END
>
> In code: (Note: Thrown together - check carefully)
>
> MemHandle tempH;
> Char* temp;
>
> if (tempH = DmGetResource (verRsc, 1000)) {
> if (temp = (Char*)MemHandleLock (tempH)) {
> FrmCustomAlert(AboutAlert, temp, " ", " ");
> MemPtrUnlock(temp);
> }
> DmReleaseResource(tempH);
> }
>
Another way:
If you have a way to update the date in the makefile (I use a program I
wrote called dt.exe) to write the date into a file called "created.txt"
every time I compile. Then I refer to the file in the rcp file like this:
VERSION ID 1 "1.2"
DATA "crdt" ID 1 "created.txt"
Then to get the resource into the about box from my menu handler:
char version[]="0.0";
char created[]="MMM DD YYYY";
switch (event->data.menu.itemID)
{
case menuitemID_about:
// get version number
memHandle = DmGet1Resource ('tver', 1);
memPtr = MemHandleLock (memHandle);
StrCopy (version, memPtr);
MemHandleUnlock (memHandle);
DmReleaseResource (memHandle);
// get program creation date
memHandle = DmGet1Resource ('crdt', 1);
memPtr = MemHandleLock (memHandle);
StrCopy (created, memPtr);
MemHandleUnlock (memHandle);
DmReleaseResource (memHandle);
// show alert
FrmCustomAlert (alertID_about, version, created, NULL);
break;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/