Lesson 2: Configuring Your Development Environment

Overview

In order to use an integrated development environment (IDE) to build an application that uses GeoCalc, some settings in the IDE must be adjusted.  This generally consists of these steps:

  1. Installing the DataSourceComponent in the development environment

  2. Dropping the DataSourceComponent into a project

  3. Re-building the application, so that the updated settings are applied to the project

Some environments also require the adjustment of other settings.  Below, you can find specific instructions for configuring the following environments:

 

Visual Studio 2003 - C++.NET

  1. Create a new C++.NET application.
  2. In a text editor, such as Notepad, create a file called licenses.licx that contains the line “GeoCalcNET.DataSourceComponent, GeoCalcNET” (without the quotes).  Save this file to the output director for your project.
  3. Copy GeoCalcNET.dll and GeoCalcNET.lic into the output director of your project (by default these can be found in c:\bmg\GeoCalcNET\redist\).
  4. Go to the output directory of your project and run the command “lc /target:<application name>.exe /complist:licenses.licx /i:GeoCalcNET.dll”, where <application name> is a place holder for the name of your application.  This command will generate a file called <application name>.exe.licenses.
  5. In you project properties, Configuration Properties->Linker->Input->Embed Managed Resource File, add the path and filename of the file generated in Step 4.
  6. Add a reference to GeoCalcNET.dll to your project.
    1. Select Project->Add Reference…
    2. Select the .NET tab.
    3. Click the Browse button and browse to GeoCalcNET.dll (by default c:\bmg\GeoCalcNET\redist\GeoCalcNET.dll).
  7. Build the application.

 

Visual Studio 2003 - C#.NET or VB.NET

  1. Create a new C#.NET or VB.NET Windows Application.
  2. Right-click on the Toolbox and select Add/Remove Items…
    1. Select the .NET tab and click the Browse button.
    2. Browse to GeoCalcNET.dll (by default c:\bmg\GeoCalcNET\redist\GeoCalcNET.dll) and open this file.
    3. Click OK in the Customize Toolbox dialog.
  3. There will now be a new item in the Toolbox called DataSourceComponent.  Drag this onto a form.
  4. Build the application.