GPS4Palm

Source Code Documentation


importGeoDBLocation.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * $RCSfile: importGeoDBLocation_8c-source.html,v $
00004  *
00005  * This routine gets the "selected" reference from GeoDB
00006  * 
00007  * Author: David W. Bray. Email bray@davidbray.org
00008  *
00009  * importGeoDBLocation() is in the public domain -- November 2003.
00010  *
00011  * $Date: 2007-10-08 20:40:33 $
00012  *
00013  * $Revision: 1.4.2.1 $
00014  *
00015  * $Log: importGeoDBLocation_8c-source.html,v $
00015  * Revision 1.4.2.1  2007-10-08 20:40:33  mp
00015  * updated for gps4palm V0.9.5 beta
00015  *
00016  * Revision 1.1  2005-01-29 10:20:04  mp
00017  * imported from example code (importGeoDBLocation.zip) by David W. Bray
00018  *
00019  *
00020  ****************************************************************************/
00021 
00022 // Required headers
00023 #include "PalmOS.h"
00024 #include "PalmCompatibility.h"
00025 
00026 #include "geodb.h"
00027 
00028 // External Global
00029 extern Location location;
00030 
00031 Boolean importGeoDBLocation(void)
00032 { DWord resultP;
00033   DmSearchStateType searchState;
00034   Word  cardNo;
00035   Err error;
00036   LocalID geoDBLocalID;
00037 
00038   // open the GeoDB database and get the selected location data
00039   if (DmGetNextDatabaseByTypeCreator(true, &searchState, geoDBType, geoDBCreator,
00040                 false, &cardNo, &geoDBLocalID))
00041         return false;
00042 
00043    error = SysAppLaunch(cardNo, geoDBLocalID, 0, 33001, (Ptr)&location, &resultP);
00044    if (resultP != 0 || error || StrLen(location.name) < 1) return false;
00045 
00046    return true;
00047 }
00048 

Created: Mon, 08 Oct 2007 22:33:16 +0200
Copyright ©2004 M. Prinke