Programming ArcGIS in Visual C++


About programming ArcGIS in Visual C++

Developing in Visual C++ is a large and complex subject, as it provides a much lower level of interaction with the underlying Windows APIs and COM APIs when compared to other development environments.
While this can be a hindrance for rapid application development, it is the most flexible approach. A number of design patterns, such as COM aggregation and singletons, that are possible in Visual C++ are not possible in Visual Basic 6. By using standard class libraries, such as ATL, the complex COM plumbing code can be hidden. However, it is still important to have a thorough understanding of the underlying ATL COM implementation.
Since ArcGIS 9.2 supports only MS Visual Studio 2005 (Version 8) the documentation in this section is based on this development environment. In the document we will refer to it as VS8. While VS8 can work with the managed .NET environment, and it is possible to work with the ArcGIS .NET API, this will only add overhead to access the underlying ArcGIS COM objects. So for the purposes of ArcGIS development in VS8, it is recommended to work the "traditional" way, that is, directly with the ArcGIS COM interfaces and objects.
With the ability to develop with the Visual C# .NET language, it is worth considering porting Visual C++ code to this environment and using the ArcGIS .NET API. The syntax of C# is not unlike C++, but the resulting code is generally simpler and more consistent.
This section is intended to serve two main purposes: to familiarize you with general Visual C++ coding style and debugging, beginning with a discussion on ATL, and to detail specific usage requirements and recommendations for working with the ArcObjects programming platform in Visual C++.
In this section
 
General guidelines and considerations when developing with ArcObjects.
ArcObjects is based on Microsoft's Component Object Model (COM). As a developer intent on building solutions based on ArcObjects or extending the existing ArcGIS applications using ArcObjects, an understanding of COM is a requirement.
Active Template Library (ATL) helps you implement COM objects and saves typing. This topic serves as an introduction to this framework for implementing COM objects.
Smart types are objects that behave as types. The two main smart types covered in this topics are Direct-To-COM and the Active Template Library.
Some naming convention suggestions.
Tips to help you get the most from your debugging session in Visual Studio 8.
Using the #import command to reference ArcGIS interfaces, types, and objects.
Discussion of terminology and usage for working with COM events in VC++ and ATL.
ArcGIS Engine includes a number of ActiveX controls that can simplify application development. This topic highlights how to use ATL to add these controls to a dialog box.
This topic discusses hosting the controls on a dialog box using the MFC framework.