主要部分是下面吧,找同事要的,没仔细看过
CString oneline;
oneline = dacstr.Mid(start, linelen);
onestart = 0;
oneend = 0;
if(oneline.Left(6) == L"$GPGGA")
{
onestart += oneline.Find(L",", onestart);
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart - 1;
time = oneline.Mid(onestart + 1, length);
time = time.Left(2) + L":" + time.Mid(2,2) + L":" + time.Right(5);
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
lat = oneline.Mid(onestart, length);
degdig = lat.GetLength() - 2;
lat = lat.Left(2) + L"°" + lat.Right(degdig);
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
latdir = oneline.Mid(onestart, length);
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
lon = oneline.Mid(onestart, length);
degdig = lon.GetLength() - 3;
lon = lon.Left(3) + L"°" + lon.Right(degdig);
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
londir = oneline.Mid(onestart, length);
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
numused = oneline.Mid(onestart, length);
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
onestart = oneend+1;
oneend = oneline.Find(L",", onestart+1);
length = oneend - onestart;
alt = oneline.Mid(onestart, length);
}