Anson, Gary wrote in message <5385@palm-dev-forum>...
>
>How do I go about getting the version number reported in the Info screen
>from within the app?
>

This is my "generic about box" routine.  You must have an Alert
resource defined w/ places to put the information.  Mine says:

--- begin AboutBoxAlert resource text ---
^1 version ^2

Copyright � 1999
Richard M. Hartman
--- end AboutBoxAlert resource text ---

void DoAboutBox(void)
{
 // FrmAlert(AboutBoxAlert);
 VoidHand hAIN, hver; // hAIB, hInfo;
 CharPtr pAppName = "(appname)";
 CharPtr pAppVersion = "(appversion)";

 //- ainRsc(tAIN) = app name ID=ainID(1000)
 hAIN = DmGet1Resource(ainRsc, ainID);
 if (hAIN)
  pAppName = MemHandleLock(hAIN);

 //- verRsc(tver) = version string (ID=appVersionID(1) or
appVersionAlternateID(1000))
 // (GCC tends to use appVersionID, CW uses appVersionAlternateID)
 hver = DmGet1Resource(verRsc, appVersionAlternateID); // I use CW, check
this first
 if (!hver)
  hver = DmGet1Resource(verRsc, appVersionID);
 if (hver)
  pAppVersion = MemHandleLock(hver);

 //- show it all now!
 FrmCustomAlert(AboutBoxAlert, pAppName, pAppVersion, "");

 //- clean up
 if (hAIN) {
  MemHandleUnlock(hAIN);
  DmReleaseResource(hAIN);
 }
 if (hver) {
  MemHandleUnlock(hver);
  DmReleaseResource(hver);
 }

}



--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi/sec: not just a good idea, it's the LAW!




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to