Knowledge Base Article
KB10220 - I am using the DK with C++Builder and experienced a problem with the Locate functionality. The compiler rejects the following code as invalid:
TGIS_Shape *shp = new TGIS_Shape();
with the errors:
E2352 Cannot create instance of abstract class 'TGIS_Shape'
E2353 Class 'TGIS_Shape' is abstract because of '_fastcall TGIS_Shape::getSmartSize() = 0'
(this is used in the MouseMove and MouseDown procedures)
The Locate function does not create a shp!
shp := TGIS_Shape(GIS.Locate(ptg, 5/GIS.Zoom)); // 5 pixels precision
So your code should look like:
TGIS_Shape *shp := (TGIS_Shape)(GIS.Locate(ptg, 5/GIS.Zoom)); // 5 pixels precision
In any future work please create a known type of object. For example:
TGIS_Shape *shp = new TGIS_ShapeArc();
Created: 2003-11-21, Modified: 2005-09-14
|