This code showcases the Melissa GeoCoder Object using C++.
Please feel free to copy or embed this code to your own project. Happy coding!
For the latest Melissa GeoCoder Object release notes, please visit: https://releasenotes.melissa.com/on-premise-api/geocoder-object/
For further details, please visit: https://docs.melissa.com/on-premise-api/geocoder-object/geocoder-object-quickstart.html
The console will ask the user for:
- Zip
And return
For US:
- Place Name
- County
- County Subdivision Name
- Time Zone
- Latitude
- Longitude
- Result Codes
For Canada:
- Time Zone
- Latitude
- Longitude
- Windows 10 64-bit Microsoft Visual C++ 14.34, Powershell 5.1
- Melissa data files for 2025-Q4
- Nmake 14.34
- Visual Studio 2022 Developer Command Prompt v17.4.2 64-bit
This is the c++ version of the Melissa Object.
- mdGeoCode.db3
- mdEnums.h
- mdGeo.h
- mdGeo.lib
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
It is important to note that you must be able to initialize the Visual Studio Developer Command Prompt environment for x86_x64 in order to test the Melissa GeoCoder Object. The Visual Studio Developer Command Prompt should already be downloaded if you have Microsoft Visual Studio installed.
To check if you are able to intialize the Visual Studio Developer Command Prompt for x86_x64, you can open the start menu and search for x86_x64 Cross Tools Command Prompt for VS 2022. If this program exists, then you may continue to the next steps.
Alternatively, you can check to see if the following filepath exists: C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsall.bat (with Visual Studio 2022 installed). If the filepath exists, then you may continue to the next steps.
If running Powershell for the first time, you will need to run this command in the Powershell console: Set-ExecutionPolicy RemoteSigned.
The console will then prompt you with the following warning shown in the image below.
- Enter
'A'.- If successful, the console will not output any messages. (You may need to run Powershell as administrator to enforce this setting).
git clone https://github.com/MelissaData/GeoObject-Cpp
cd GeoObject-Cpp
Melissa Updater is a CLI application allowing the user to update their Melissa applications/data.
- You can download the Melissa Updater here: https://releases.melissadata.net/Download/Library/WINDOWS/NET/ANY/latest/MelissaUpdater.exe
- Create a folder within the cloned repo called
MelissaUpdater. - Put
MelissaUpdater.exeinMelissaUpdaterfolder you just created.
- Using Melissa Updater
- It will handle all of the data download/path and dll(s) for you.
- If you already have the latest release zip, you can find the data file(s) in there
- To pass in your own data file path directory, you may either use the '-dataPath' parameter or enter the data file path directly in interactive mode.
- Comment out this line "DownloadDataFiles -license $License" in the powershell script.
- This will prevent you from having to redownload all the files.
Parameters:
-
-zip: a test zip code
-
For US: Zip code format can be 5-digit or 9-digit, with or without hyphen(-) delimiter.
-
For Canada: Zip code format must be a full 6-digit Canadian Postal Code, with or without a space.
This is convenient when you want to get results for a specific zip code in one run instead of testing multiple zip codes in interactive mode.
-
-
-dataPath (optional): a data file path directory to test the GeoCoder Object
-
-license (optional): a license string to test the GeoCoder Object
-
-quiet (optional): add to the command if you do not want to get any console output from the Melissa Updater.
When you have modified the script to match your data location, let's run the script. There are two modes:
-
Interactive
The script will prompt the user for a zip code, then use the provided zip to test GeoCoder Object. For example:
.\MelissaGeoCoderObjectWindowsCpp.ps1For quiet mode:
.\MelissaGeoCoderObjectWindowsCpp.ps1 -quiet -
Command Line
You can pass a zip code in the
-zipparameter and a license string in-licenseparameter to test GeoCoder Object. For example:.\MelissaGeoCoderObjectWindowsCpp.ps1 -zip "92688" .\MelissaGeoCoderObjectWindowsCpp.ps1 -zip "92688" -license "<your_license_string>"For quiet mode:
.\MelissaGeoCoderObjectWindowsCpp.ps1 -zip "92688" -quiet .\MelissaGeoCoderObjectWindowsCpp.ps1 -zip "92688" -license "<your_license_string>" -quiet
This is the expected output from a successful setup for interactive mode:
Troubleshooting for errors found while running your program.
| Error | Description |
|---|---|
| ErrorRequiredFileNotFound | Program is missing a required file. Please check your Data folder and refer to the list of required files above. If you are unable to obtain all required files through the Melissa Updater, please contact technical support below. |
| ErrorLicenseExpired | Expired license string. Please contact technical support below. |
For free technical support, please call us at 800-MELISSA ext. 4 (800-635-4772 ext. 4) or email us at tech@melissa.com.
To purchase this product, contact the Melissa sales department at 800-MELISSA ext. 3 (800-635-4772 ext. 3).

