18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C++ APPLICATION PROGRAMMING INTERFACE<br />

In VS .NET 2003:<br />

a. You want a simple C++ program, so use the wizard that you will use for<br />

your C++ API development: the C/C++ Console Application wizard. This<br />

wizard is not the same as the Win32 Console Project and Console Application<br />

(.NET) wizards. To access the C/C++ Console Application wizard,<br />

you must install Academic Tools for VS .NET 2003. This is available from<br />

the downloads page at http://msdn.microsoft.com/academic/default.aspx. Once<br />

you have installed the wizard, open a new Visual C++ project of the type<br />

C/C++ Console Application and name it configtest.<br />

b. Replace the contents of the existing configtest.cpp file with the code<br />

above.<br />

3. Press Ctrl+F5, and click Yes to build the .exe file. A window should open that<br />

says Hello world.<br />

4. If you had trouble with any of the steps above, your system is not yet configured<br />

for C++ programming, and you should refer to your system documentation<br />

or system support personnel to get it set up.<br />

• Solaris and Linux:<br />

1. Open your text editor and paste the code snippet from above. Save it as<br />

configtest.cpp.<br />

2. At the command prompt, type one of the following:<br />

• Solaris: “CC -o configtest configtest.cpp” (without the quotes)<br />

• Linux: “g++ -o configtest configtest.cpp” (without the quotes)<br />

3. A new file, configtest, will be created. Run it by typing “./configtest” (again<br />

without the quotes).<br />

4. Hello world will be displayed.<br />

5. If you had trouble with any of the steps above, your system is not yet configured<br />

for C++ programming, and you should refer to your system documentation<br />

or system support personnel to get it set up.<br />

Platform configuration<br />

1. First you will need to pick your development platform: Windows, Solaris, or<br />

Linux. This will be a decision based on your ArcObjects programming intentions,<br />

as well as your experience.<br />

• Windows: If you are planning to write command-line ArcObjects applications<br />

and most of your programming experience is on Windows, you should<br />

use Windows as your platform. Your code will still be cross-platform; you will<br />

just need to recompile it on Linux and Solaris.<br />

However, if you plan to write an application with the Motif or GTK widget<br />

<strong>ArcGIS</strong> controls, you will not be able to develop on Windows as those controls<br />

are only available on UNIX. To develop with the <strong>ArcGIS</strong> controls on<br />

Windows, you will need to use another API and its controls, such as the<br />

Visual C++ COM API and the COM controls.<br />

208 • <strong>ArcGIS</strong> <strong>Engine</strong> <strong>Developer</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!