18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VISUAL C++<br />

COM coclass header files in VC7 contain much less ATL code than at VC6. As<br />

IDL is generated from attributes, there is typically no .idl file present in COM<br />

projects as before, and the .idl file is generated at compile time.<br />

Build configurations—There are only two default build configurations in VC7;<br />

these are ANSI Debug- and Release-based builds. As <strong>ArcGIS</strong> is only available on<br />

Unicode platforms, it is recommended to change these by modifying the project<br />

properties. The general project properties page has an option for Character Set.<br />

Change this from Use Multi-Byte Character Set to Use Unicode Character Set.<br />

Character conversion macros—The character conversion macros<br />

(USES_CONVERSION, W2A, W2CT, and so forth) have improved alternative<br />

versions. These no longer allocate space on the stack, so they can be used in loops<br />

without running out of stack space. The USES_CONVERSION macro is also no<br />

longer required. These macros are now implemented as classes and begin with a<br />

“C”—for example, CW2A, CW2CT.<br />

Safe array support—This is available with CComSafeArray and<br />

CComSafeArrayBound classes.<br />

Module level global—The module-level global CComModule _module has<br />

been split into a number of related classes, for example, CAtlComModule and<br />

CAtlWinModule. To retrieve the resource module instance, use the following<br />

code: _AtlBaseModule.GetResourceInstance();<br />

String support—General variable length string support is now available through<br />

CString in ATL. This is defined in the header files atlstr.h and cstringt.h. If ATL<br />

is combined with MFC, this defaults to MFC’s CString implementation.<br />

Filepath handling—A collection of related functions for processing the components<br />

of filepaths is available through the CPath class defined in atlpath.h.<br />

ATLServer—This is a new selection of ATL classes designed for writing Web<br />

applications, XML Web services, and other server applications.<br />

#import issues—When using #import, a few modifications are required. For<br />

example, the #import of esriSystem requires an exclude or rename of GetObject,<br />

and the #import of esriGeometry requires an exclude or rename of ISegment.<br />

ATL REFERENCES<br />

The Microsoft <strong>Developer</strong> Network provides a wealth of documentation, articles,<br />

and samples that are installed with Visual Studio products. ATL reference documentation<br />

for Visual Studio version 6 is under:<br />

MSDN Library - October 2001 / Visual Tools and Languages / Visual Studio 6.0<br />

Documentation / Visual C++ Documentation / Reference / Active Template Library<br />

Additional documentation is also available on the MSDN Web site at<br />

http://www.msdn.microsoft.com<br />

You may also find the following books to be useful:<br />

Grimes, Richard. ATL COM Programmer’s Reference. Chicago: Wrox Press Inc.,<br />

1988.<br />

Grimes, Richard. Professional ATL COM Programming. Chicago: Wrox Press Inc.,<br />

1988.<br />

Chapter 4 • <strong>Developer</strong> environments • 109

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

Saved successfully!

Ooh no, something went wrong!