|
|
t e m p o r a l |
d o o r w a y |
||||||||||||||
Upgrading MapX To 3.5 For CBuilder Users |
||||||||||||||||
|
Back up everything, including the CBuilder generated MAPX20 files from $(BCB)\Lib and the entire MapX directory, and especially any components or projects which use mapping components or the MapX header files. Make sure CBuilder will start with an empty project - if you start with a project that uses MapX, you may have a problem. Be prepared for the possibility that you may decide to restore the registry; this is needed if there is a problem with the MapX installation, and can be done by (from the help in Regedit.exe):
Install the CD. Restart your system. Run CBuilder. Remove Mapx version 2 from the component palette; you must remove any components derived from it or using it, to force the TMap class to be deregistered from the component library. Rebuild the component palette. Install MapX Version 2 from the ActiveX button. Rebuild the component palette. The complilation will fail with an error, but you need to do this to get the .pas file generated. There will be a problem due to the use of long integers for new color constants. Comment out the following lines in MapX30.pas
The compilation will be successful and the component will be added to the ActiveX tab of the Component Palette. Next, drop the component on the empty form of the default application, and save the project. Compile and run it. This is just a very basic test to make sure everything so far is OK. Warning: If you try to change the geoset for this default application, it will appear that your geosets can be found. This is misleading. The location of the tables in your geosets will have been lost. You must recreate your geosets. This is done with MapX\Maps\GeosetManager.exe, which can also now establish default characteristics for the layers specified. Next, find any components which you have created that are derived from or directly use MapX. If you have been smart, you originally derived a class from MapX and used that in all applications, all further derived components, and all aggregate components, in which case, most of your changes will be to that single component. In any event, look for
(Note: your paths may be different). Change these lines to
Also change Change the MapX header files in accordance with my recommendations for MapX 2.0 changes. Note: in this version you must add the line #include <stdafx.h> to the top of the new MapX\Samples30\Cpp\MapX.h Rename the MapX/Samples20 directory so that any references to the old MapX headers will fail in compilation. Move all MapX20.* files from $(BCB)\Lib so that any references to those will fail in compilation. Edit $(BCB)\Bin\cmplib32.opt and change all occurrences of Samples20 to Samples30. If you made any changes to MapX.h or MapX.cpp in the previous version, make them again now. Add MapX/Samples30/Mapx.cpp to some project and compile it to create MapX.obj Reinstall the previously removed components. If necessary, change the search path line in that dialog to look in Samples30, not Samples20. At this point you are ready to bring in your applications for recompilation. You may experience an "Unknown Error" or "Unknown problem" exception. If you do, it may be a result of the presence of the "Control Data" from Mapx20 in your .dfm file. If so, you will need to delete that part of the .dfm. Be careful. Have an extra backup before you try this, and make sure the dfm is backed up. If you are unconfortable editing this, ask for advice in the Borland newsgroups, or contact me. Also note that if you create a standalone feature (i.e. a feature you add outside of binding), you must use NewFeature->Attach(LPDISPATCH (Ole2:IDispatch *) Map->OleObject); prior to changing any characteristics (type, etc) of the new feature. Recompile your applications and test them. |
||||||||||||||||
|
Copyright © 2004 by Mark
Cashman (unless otherwise indicated), All Rights Reserved
|