When using GeoCalc with Microsoft Visual Studio 6, there are some special considerations that must be made in order to avoid errors. The reason for this is that GeoCalc was built with Visual Studio 2003, and there is some incompatibility between the runtime libraries used by Visual Studio 2003 and Visual Studio 6.
Specifically, when deleting objects, you may encounter an error similar to this:
Invalid Address specified to RtlValidateHeap( a70000, 18b0990 )
Invalid Address specified to RtlFreeHeap( a70000, 18b0990 ).
You may also be presented with a dialog like this
,
or this
.
These errors can be avoided if the appropriate constructor is used for each object in GeoCalc. Most objects have two forms of constructors. There is the standard constructor that you would use the keyword "new" with to instantiate an object. For example:
GeoCalcPBW::ObjectPicker * picker = new GeoCalcPBW::ObjectPicker(...);
There is also a constructor that takes the form of a static method. For example:
GeoCalcPBW::ObjectPicker * picker = GeoCalcPBW::ObjectPicker::CreateObjectPicker(...);
When you wish to create an object that inherits from Serializable, such as AngularUnit or HorizontalDatum, you should use the 'create' constructor. When you wish to create an object that does not inherit from Serializable, such as AngularValue or DataBrowser, you should use the 'new' constructor. The following example shows how you would instantiate a couple different objects in VC6:
GeoCalcPBW::AngularUnit * au = GeoCalcPBW::AngularUnit::CreateAngularUnit();
GeoCalcPBW::AngularValue * av = new GeoCalcPBW::AngularValue();
GeoCalcPBW::DataBrowser * browser = new GeoCalcPBW::DataBrowser(...);
GeoCalcPBW::HorizontalDatum * datum = GeoCalcPBW::HorizontalDatum::CreateHorizontalDatum();