[Function]: MAPX VC Custom Ranging Tool (POLYTOOLUSED Event) [Environment]: VC6 MAPX4.5 Win2000 [Original]: www.51gis.com//1. Define constants #define mytool_distance 100 // 1 ~ 999 // 2 creation tools m_ctrlMap.CreateCustomTool (MYTOOL_DISTANCE, miToolTypePoly, miCrossCursor);. // 3 in response to events void CMapXSampleView :: OnPolyToolUsedMap (short ToolNum, long Flags, LPDISPATCH Points, BOOL bShift, BOOL bCtrl, BOOL FAR * EnableDefault) {// Calculating distance if (flags == mipolytoolinprogress) {// This sentence can have no IF (toolnum == mytool_distance) {cmapxpoints PTS; long N; long i; try {pts.attachdispatch (Points, False); / / GET POINTS Objectdouble DdistanceTot = 0.0; N = Pts.getCount (); for (i = 1; i
================== MapX expert forum (www.51gis.com) ==============================================================================================================================================