void CAirportsManager::GetAirportCoordinates(const CString strAirport, CLatitude& tlat, CLongitude& tlong ) { int iAirportIndex = FindOrAddEntry(strAirport); CString strCorrd; if(iAirportIndex >= 0 ) { CAirport * pAirport = GetAirportList()->at(iAirportIndex); ASSERT(pAirport); if(pAirport) strCorrd = pAirport->m_sARPCoordinates; } //get lat long form str; if( strCorrd.CompareNoCase("") !=0 ) { CString strLongitude; CString strLatitude; int nIndex = strCorrd.Find("-"); strLongitude = strCorrd.Left(nIndex); tlong.SetValue(strLongitude); strLatitude = strCorrd.Right(strCorrd.GetLength() - nIndex-1); tlat.SetValue(strLatitude); } }
int AddEntry( int command, int hash ) { // Clear list if command number changes if ( command != m_nCurrentCommand ) { Reset( command ); } entry *e = FindOrAddEntry( hash ); if ( !e ) return 0; e->count++; return e->count-1; }