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.

C++ APPLICATION PROGRAMMING INTERFACE<br />

When using the smart type CComBSTR, the above two functions will not be<br />

needed. However, you can create and free BSTRs with them, as illustrated in the<br />

following example:<br />

// Display the feature type as "simple" or "other".<br />

BSTR bsFeatureType;<br />

esriFeatureType featType;<br />

pFeatureClass->get_FeatureType(&featType);<br />

switch (featType)<br />

{<br />

case esriFTSimple :<br />

bsFeatureType = ::AoAllocBSTR(L"simple");<br />

break;<br />

default:<br />

bsFeatureType = ::AoAllocBSTR(L"other");<br />

}<br />

std::wcerr get_Fields(&ipFields);<br />

long fieldCount;<br />

hr = ipFields->get_FieldCount(&fieldCount);<br />

IFieldPtr ipField;<br />

226 • <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!