You are on page 1of 16

Chapter 16: Distributing Your MapX Application

MapX Customer Installation Installing the MapX OCX Installing Support for Spatial Server Access Installing Raster Format Handlers Installing Maps and Geosets Adding Keys to the Windows Registry Passing in the MapX license String Redistributing Your MapX Application With MrSID

Distributing Your MapX Application

The MapX product you have purchased from MapInfo is a developer's kit. It contains the MapX OCX, sample programs, an on-line help system, sample maps and geosets, and various utilities and other support files. This chapter deals with distributing your MapX application(s) to your customers. Please be reminded that you must purchase a Use License (i.e., seat) as evidenced by a MapInfo License certificate for each user of each application that you distribute with MapX functionality as described in the MapInfo Standard License/Development Environments, which is included in your product packaging.

Chapter 16: Distributing Your MapX Application

MapX Customer Installation

Providing MapX Control (i.e. the piece of MapX that needs to be distributed within your applications in order for them to work properly) in your MapX applications can be a difficult task for the inexperienced programmer due to the high number of dependent files and their complex structure. Therefore, MapInfo Corporation has begun automating the distribution process. Basically, there are two methods of distributing the MapX Control with your MapX applications. They are: Use the MapX OCX Installer that is provided on the MapX CD. This is the easiest method of distribution as it entails very little effort on the part of a MapX developer because certain procedures and tasks are automated. Integrate MapX control at runtime within the application you wish to distribute. This method of distribution is labor intensive and requires a substantial level of detail orientation, but provides programmers with the highest degree of control and customizing capabilities possible.

Using the MapX OCX Installer to Distribute the MapX Control

Basically there are only two steps needed to provide Map Control via the OCX Installer. They are: 1. Select the MapX OCX Installer files located in [CD]\MapXtras\MapXRuntime on. This will automatically install the MapX mapping engine and the Geoset Manager. The default installation location is: Program Files\Common Files\MapX Common. 2. Make sure all licensing agreements with MapInfo Corporation and data providers are appropriately adhered to.

Example of Using the MapX OCX Installer

MapXOcxPath = SRCDISK ^ MAPX_OCX_CD_PATH; // launch the MapXocx setup if (Is(FILE_EXISTS, MapXOcxPath ^ "setup.exe")) then // Display a message to the user about us setting up the DAO SdShowMsg (@MSG_OCX_MESSAGE, TRUE); ChangeDirectory(MapXOcxPath ); LaunchAppAndWait(MapXOcxPath^"setup.exe","",WAIT)


MapInfo MapX Developer Guide v4.5

MapX Customer Installation // IMPORTANT NOTE: If using the Software Copy Protected (SCP) version of the MapX OCX Installer, use the following line instead. // LaunchAppAndWait(MapXOcxPath^"setup.exe","MAPXSCP",WAIT) // Passing the argument "MAPXSCP" with force the SCP version of the OCX to get installed. // Done setting up, remove sessage SdShowMsg (@MSG_OCX_MESSAGE, FALSE); endif;

Files Installed Automatically with the Installer OCX

These files are automatically installed when the OCX Installer method of adding Map Control is used. These files are installed to: C:\Program Files\Common Files\MapInfo Shared\MapX Common\ mdatasetint.tlb AllTypeRes.dll MMapXColumnInfo.dll ColLookupSystem.dll mirdbspatialRes.dll CommandProcessor.dll COORDSYS.DLL DAENGINE.DLL DBInfoRes.dll ExprPacket.dll ExprPacketRes.dll GEO.DLL GEOSET.DLL GeosetRes.dll LEXER.DLL MapBasicInternalFcnres.dll MapperRes.dll METADATA.DLL MIRDB.DLL ALLTYPE.DLL RASTER.DLL RegTypLib.exe TextFileReaderRes.dll UTILITY.DLL

CommandProcessorRes.dll COMPILER.DLL CoordSysRes.dll DAEngineRes.dll DBLAYER.DLL ExprPacketCreator.dll FcnInfoServer.dll GeoObject.dll GeosetManager40.exe LEGEND.DLL LEXERRES.DLL MAPINFOW.PRJ MAPX.ABB MIDLG40.DLL MIRDBRES.DLL PROGRAM.DLL RasterRes.dll STYLES.DLL Thematics.dll CustomProperties.dll DBINFO.DLL DBLayerRes.dll ExprPacketCreatorRes.dll FcnInfoServerres.dll GeoObjectRes.dll GeosetManagerIntl40.dll LegendRes.dll MapBasicInternalFcn.dll MAPPER.DLL MAPX.PEN MIDLIN40.DLL mirdbspatial.dll ProgramRes.dll REGSVR32.EXE TextFileReader.dll TOKENS.DLL

MapInfo MapX Developer Guide v4.5


Chapter 16: Distributing Your MapX Application UtilityRes.dll FIND.DLL FINDRES.DLL




MapInfo MapX Developer Guide v4.5


Integrating MapX into Applications at Runtime

When you deliver your application to customers, you will need to install: The software you created MapX Control (Either via the MapX OCX Installer OR your own, customized version) Related support files Maps and geosets that are used by your application

Ideally you will incorporate the installation of MapX into your installation procedure, so that your end user wont need to perform a separate installation to install MapX. There are four main steps to installing and distributing MapX applications: 1. Install the necessary files onto your user's computer. 2. Run utilities (such as regsvr32.exe) to register specific files on the user's system. 3. Add specific keys to the Windows registry 4. Pass in the MapX license string at application runtime.
Note: If you are using MapX in a dialog with Visual C++, VisualBasic, Delphi, or

PowerBuilder they will take care of creating MapX with the correct license string and therefore you can skip this section. If you are creating the MapX control using the CMapX::Create() method in Visual C++ you do need to take this extra step. The files that are installed with MapX can be divided into the following categories: Required files: MapX OCX and its dependent DLLs Windows system files: including fonts, MFC, and OLE dlls

MapInfo MapX Developer Guide v4.5


Chapter 16: Distributing Your MapX Application Optional files: Dataset drivers (used for databinding) Import/Export raster handlers Maps and Geosets

The Installshield sample provided on the MapX Installation CD only illustrates how to install the required files. This chapter will cover installation requirements for the required files and the optional files.

Installing the MapX OCX

If you have installed MapX on your own computer, its easy to get a rough idea of how many files are used by MapX. In previous versions of MapX, all of the files were installed under the old MapX program directory (which defaults to \Program Files\MapInfo\MapX 4.0\Program). MapX v4.0 and later installs the program files under the following path \Program Files\Common Files\MapInfo Sharred\MapX Common. This directory should be used for the MapX required files, whereas all of the files necessary for your application should go under a directory meaningful to the end-user and your specific application.
Note: MapX uses some files that are not located in the MapX program directory. For

example, MapX uses MFC and OLE dlls that reside in the Windows System directory. We also recommend that the MapX common directory should be: \Program Files\Common Files\MapInfo Sharred\MapXCommon. The following table describes what files need to be installed and where they should be installed to. Where to Install Files \Windows\System Other Special Requirements Do a version check before replacing these files. If older version, during replace files may be in use and require a reboot if that is the case.

Files Mfc42.dll, msvcp60.dll, msvcrt.dll


MapInfo MapX Developer Guide v4.5

Installing the MapX OCX

Files Olepro32.dll, oleaut32.dll Mapx40.ocx

Where to Install Files \Windows\System MapX common directory

Other Special Requirements Must be registered using regsvr32.exe Must be registered using regsvr32.exe. Prior to registering the OCX, make sure the MapX dependent files are installed. Must be registered using regsvr32.exe Must be registered using regtyplib.exe

MMapXColumnInfo.dll mdatasetint.tlb

MapX common directory MapX common directory

MapInfo MapX Developer Guide v4.5


Chapter 16: Distributing Your MapX Application


Where to Install Files

Other Special Requirements

MapX common MapX dependent files: directory ALLTYPE.DLL, AllTypeRes.dll, ColLookupSystem.dll, CommandProcessor.dll, CommandProcessorRes.dll, COMPILER.DLL, COORDSYS.DLL, CoordSysRes.dll, CustomProperties.dll, DAENGINE.DLL, DAEngineRes.dll, DBINFO.DLL, DBInfoRes.dll, DBLAYER.DLL, DBLayerRes.dll, ExprPacket.dll, ExprPacketCreator.dll, ExprPacketCreatorRes.dll, ExprPacketRes.dll, FcnInfoServer.dll, FcnInfoServerres.dll, FIND.DLL, FINDRES.DLL, GEO.DLL, GeoDictionaryManager40.exe, GeoDictionaryManagerIntl40.dll, GeoObject.dll, GeoObjectRes.dll, GEOSET.DLL, GeosetManager40.exe, GeosetManagerIntl40.dll, GeosetRes.dll, LEGEND.DLL, LegendRes.dll, LEXER.DLL, LEXERRES.DLL, MapBasicInternalFcn.dll, MapBasicInternalFcnres.dll, Mapinfow.fnt, MAPINFOW.PRJ, MAPPER.DLL, MapperRes.dll, MAPX.ABB, MAPX.PEN, METADATA.DLL, MIDLG40.DLL, MIDLIN40.DLL, MIRDBRES.DLL, Mxintl40.dll, PROGRAM.DLL, ProgramRes.dll, RASTER.DLL, RasterRes.dll, REGSVR32.EXE, RegTypLib.exe, STYLES.DLL, TextFileReader.dll, TextFileReaderRes.dll, Thematics.dll, TOKENS.DLL, Tools.dll, UTILITY.DLL, UtilityRes.dll, ThematicsRes.dll, GeoRes.dll


MapInfo MapX Developer Guide v4.5

Installing the MapX OCX


Where to Install Files Windows\Fonts directory

Other Special Requirements These fonts have to be installed and registered with the operating system. Please see below for moreinformation.

MapX common directory

Only required if using layers with the NAD 27 and NAD 83 coordinate systems.

MapInfo MapX Developer Guide v4.5


Chapter 16: Distributing Your MapX Application

Files Bitmap symbols: TOWE1-32.BMP, POLI1-32.BMP, MBOX2-32.BMP, GOLF1-32.BMP, TOWE2-32.BMP, RAIL1-32.BMP, MOSQ1-32.BMP, HOSP1-32.BMP, IEL2-32.BMP, RAIL2-32.BMP, ONEW1-32.BMP, HOUS1-32.BMP, ADG1-32.BMP, ONEW2-32.BMP, HOUS2-32.BMP, ADG2-32.BMP, HOUS3-32.BMP, ANK1-32.BMP, ANK2-32.BMP, OOK1-32.BMP, AMP1-32.BMP, TRAF1-32.BMP, AR132.BMP, TRUC1-32.BMP, RAIL332.BMP, AUT1-32.BMP, TRUC232.BMP, REST1-32.BMP, PENC132.BMP, HUR1-32.BMP, YIEL132.BMP, STAT1-32.BMP, PIN132.BMP, HYDR1-32.BMP, AMBU132.BMP, STOP1-32.BMP,PIN232.BMP, INTE1-32.BMP, COMP132.BMP, SYNA1-32.BMP, PIN332.BMP, LITE1-32.BMP, FARM132.BMP, TARG1-32.BMP, PIN432.BMP, LITE2-32.BMP, FAST132.BMP, TAXI1-32.BMP, PIN532.BMP, MAIL1-32.BMP, FIRE132.BMP, TEMP1-32.BMP, PIN632.BMP, MBOX1-32.BMP, GLOB132.BMP, MapX SDK CD.

Where to Install Files

Other Special Requirements

Only required if using Underneath the custom bitmap symbols. MapX common directory, in a directory called Custsymb. For example: \Program Files\Common Files\MapInfo Shared\MapX Common\Custsymb

The sample Installshield program installs the above files. The sample can be found on the

MapX also uses some TrueType fonts. These font files (*.ttf) must be copied to Windows Font Folder. Fonts must also be registered with Windows. If you are using a third-party software package to create your installer, that package might handle font registration for you. Otherwise, you can register fonts manually, by calling the Win32 AddFontResource routine. Once a font is properly registered, the registry contains a corresponding key under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts


MapInfo MapX Developer Guide v4.5

Installing Support for Spatial Server Access or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

Installing Support for Spatial Server Access

If accessing data in a spatially enabled RDBMS like SpatialWare for Oracle, Informix, or DB2 or Oracle 8i Spatial, then the drivers below are needed. Spatial Server SpatialWare MapInfo ODBC Oracle 8i Spatial Dataset drivers Miodbc.dll, mirdb.dll, mirdbspatialres.dll, mirdbspatial.dll Mioci.dll, mirdb.dll, mirdbspatialres.dll Installation requirements Odbc32.dll must exist in system path Odbc32.dll must exist in system path

Registering Files and Installing Dataset Drivers

As mentioned in the preceding table, some files need to be registered. Most of the files that need to be registered can be registered by running the utility regsvr32.exe: regsvr32 /s <filespec of mapx.ocx> regsvr32 /s <filespec of olepro32.dll> regsvr32 /s <filespec of oleaut32.dll>

If your application uses the ODBC data driver, you must register MODBCDataset.dll and MMapXColumnInfo.dll. If your application uses the Notes data driver, you must register MNotesDataset.dll and MMapXColumnInfo.dll. If your application uses either the ODBC or the Notes data driver, you must register the type library as follows: regtyplib <filespec of mdatasetint.tlb> MapX allows you to bind data to a map layer. Please see, "Putting Your Data on the Map" for additional information.
Note: All of these dataset drivers should be installed in the same directory as the MapX

OCX, which is usually found in the MapX common directory: \Program Files\Common Files\MapInfo Shared\MapX Common

MapInfo MapX Developer Guide v4.5


Chapter 16: Distributing Your MapX Application This table illustrates the various options for data binding and what the installation requirements are. All of the files below must be registered with ressup32.exe. Dataset source type Lotus Notes Dataset drivers Mnotesdataset.dll Installation requirements Notes dataset driver requires nnotes.dll to be locateable through the system path. Odbc32.dll must exist in system path Delphimm.dll must exist in system path Borlndmm.dll must exist in system path

ODBC Delphi v3 Delphi v4 Safe Array ADO v2.0 RDO v2.0

Modbcdataset.dll MgenDSetDrvr.dll, DSLIBP.DLL MgenDSetDrvr.dll, Dslibp4.dll MsafeArrayDataset.dll

MapXADODS.dll, ATL.dll ADO must be installed. MapXRDODS.dll, ATL.dll RDO must be instaled.

Installing Raster Format Handlers

MapX also allows the developer to incorporate raster images into their application. A MapX application may open or write to various raster image types. The appropriate drivers must be included when distributing your application. MapX can use one of many different libraries to load a raster image. When a raster image is loaded by MapX, it will search for these DLLs and ask them if the given file can be read by that DLL. Once one answers yes, MapX knows which DLL will be doing format handling for the file. The Format handlers will be named "xxxxxxxx.RHx". The base part of the name is based on the format. The extension always begins with RH, but can end in any letter (AZ). When searching for a format handler, MapX starts with RHA, then RHB, and so forth until RHZ. This allows MapX to prioritize which handlers are used. For example, SPOT files need to be checked for before any other formats since they are just raw data that can be confused with other formats. The SPOT handler's extension is RHD. The Halo format handlers (the standard built in ones) are named RHV. The Lead Tools are named RHX.


MapInfo MapX Developer Guide v4.5

Installing Raster Format Handlers The LEADTOOLS Win32 Pro provided by LEAD Technologies, Inc and HALO Imaging libraries provided by Media Cybernetics are included with MapX. You may use either of these to display most raster files in MapX. LeadTools will load the entire raster image into memory at the time the image is referenced in MapX. This will mean that the image will take longer to load, but panning and zooming will be faster. HALO will only load what it needs to display into memory, so it will load the image faster, but panning and zooming will be slower. By default, HALO will be attempted first. You may change this order by either not including the HALO libraries when distributing your application, or by renaming the LeadTools handler from a .rhx to a .rhu or anything else not used before the letter x. There may also be some formats which are not supported by either library and therefore will have their own separate library.
Note: All of these raster handlers should be installed in the same directory as the MapX

OCX, which is usually found in the MapX common directory: \Program Files\Common Files\MapInfo Shared\MapX Common. Here is a list of handlers included with MapX: Format Handler All raster types Lead Tools Required files Migeoreg.dll, MIRASTER.DLL LTFIL70N.DLL, LTKRN70N.DLL, leadtool.rhx JPG-LFCMP70N.DLL, GIF-LFGIF70N.DLL, TIF-LFTIF70N.DLL, LFFAX70N.DLL PNG- LFPNG70N.DLL, PSD- LFPSD70N.DLL, WMF-LFWMF70N.DLL, BMP-LFBMP70N.DLL BMP-miffbmp.dll, GIF-miffgif.dll, JPG-miffjpeg.dll, PCX-miffpcx.dll, TARGA-mifftga.dll, TIF-mifftiff.dll Or you may use the TIF library provided by Lead Tools or Halo. Supported raster types and DLLs needed

Halo Libraries

Halo.rhv, mihiffl.dll




Spot.rhd Mrsid.rhe SID-MRSID32.DLL

MapInfo MapX Developer Guide v4.5


Chapter 16: Distributing Your MapX Application Supported raster types and DLLs needed

Format Handler All Grid types MapInfo GRID and Hillshading



Installing Maps and Geosets

Registering a geoset is a convenient way of registering each MapInfo table associated with that geoset into the GeoDictionary. By registering a MapInfo table in the GeoDictionary, that table can be used for autobinding. To get more information regarding autobinding, please see "Putting Your Data on the Map". If it is determined that you need to use the GeoDictionary, when you register a geoset, GeoDictionaryManager40.exe adds appropriate entries into the Geodictionary (geodict.dct). If the Geodictionary does not exist, GeoDictionaryManager40.exe creates one. This step must be done after all of the Geosets and associated tables are installed on the user s machine. Double check your geoset to see what the expected paths are for each table. For example, if you created a geoset using MapInfo tables on different areas of your hard drive, the geoset will specify the full path to anything not in the same directory as the geoset. If redistributing this geoset, the tables will have to be found in the same paths as the original geoset. To avoid this problem, copy all MapInfo tables into the same directory prior to creating the geoset. Then create the geoset in that same directory.

Adding Keys to the Windows Registry

MapX also uses the following three registry keys (which your installer must create on the end-user's system, if they do not exist already). The MapX installer creates these three keys


MapInfo MapX Developer Guide v4.5

Passing in the MapX License String when you install MapX on your system. Therefore, if you want to see what these registry keys should look like, view your system's registry using a utility such as regedit.exe. Key HKEY_LOCAL_MACHINE\Software\_ MapInfo\MapX 4.0\GeoDictionary Description String - The GeoDictionary key has the file specification for the geodictionary file. Example: C:\Program Files\myappdir\Maps\GeoDict.DCT String - The SearchPaths key has semicolon-delimited file specifications of where map files and geosets may exist; it defaults to an empty string ("") other than in the directory specified in the GeoDictionary key. String - Has the location of the folder where the OCX and support files are Located. Example: \Program Files\Common Files\MapInfo Shared\MapX Common

HKEY_LOCAL_MACHINE\Software\_ MapInfo\MapX 4.0 \SearchPaths

HKEY_LOCAL_MACHINE\Software\_ MapInfo\MapX 4.0\ CommonDLLDir

Note: The GeoDictionary path is used when adding a geoset to the MapX object

without specifying the full path of the Geoset and when using autobinding. In addition, the SearchPaths key is not necessary if not using the GeoDictionary. See Installing Maps and Geosets to determine whether or not these keys are necessary for your application.

Passing in the MapX License String

In order to instantiate a runtime version of MapX on your user s computer, the license string must be passed in at the time of object creation during the executing of your application.
Note: If you are using MapX in a dialog with Visual C++, VisualBasic, Delphi, or

PowerBuilder they will take care of creating MapX with the correct license string and therefore you can skip this section. If you are creating the MapX control using the CMapX::Create() method in Visual C++ you do need to take this extra step.

Visual C++
Again, if using MapX in a dialog in Visual C++, you do not need to perform this step.

MapInfo MapX Developer Guide v4.5


Chapter 16: Distributing Your MapX Application In order to successfully create the MapX object, you must pass the license string as the bstrLicKey parameter to CMapx::Create().

Redistributing Your MapX Application with MrSID

In the event Licensee wishes to deploy an application which supports the MrSID file format (*.sid), Licensee shall include the following text: MrSID software (specifically the mrsid32.dll) is used under license and is Copyright 1995-99, LizardTech, Inc., 1008 Western Ave., Suite 200, Seattle, WA 98104. All rights reserved. MrSID is protected by U.S. Patent No. 5,710,835. Foreign patents are pending. Unauthorized use or duplication prohibited. Patented technology in the Software was developed in part through a project at the Los Alamos National Laboratory, funded by the U.S. Government and managed by the University of California. The U.S. Government has reserved rights in the technology, including a non-exclusive, nontransferable, irrevocable, paid-up license to practice or have practiced throughout the world, for or on behalf of the United States, inventions covered by the patent, and has other rights under 35 U.S.C. 200-212 and applicable implementing regulations. For further information, contact Lizardtech.


MapInfo MapX Developer Guide v4.5