public static point getPointByName(string name) { point p = new point(); p.lat = 0; p.lon = 0; try { name = extractAddress(name); modifiedPoint mp = new modifiedPoint(); mp.str = name; Task t = Task.Factory.StartNew(delegate { Amap.getPointByName(ref mp); }); t.Wait(400); if (t.IsCompleted) { p.lat = mp.lat; p.lon = mp.lon; } } catch (Exception) { return(p); } finally { GC.Collect(); } return(p); }
public static extern void getPointByName(ref modifiedPoint p);