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.

BUILDING A COMMAND-LINE C++ APPLICATION<br />

HRESULT CalculateSlope(BSTR inPath, BSTR inName, BSTR outFile);<br />

2. After the ShutdownApp() function in RasterSlope.cpp, add the implementation<br />

for CalculateSlope(). Place the function only in this step. Upcoming steps will<br />

continue to place code into the CalculateSlope() function, unless otherwise<br />

indicated.<br />

HRESULT CalculateSlope(BSTR inPath, BSTR inName, BSTR outFile)<br />

{<br />

}<br />

3. Open the input raster workspace.<br />

HRESULT CalculateSlope(BSTR inPath, BSTR inName, BSTR outFile)<br />

{<br />

// Open the workspace.<br />

IWorkspaceFactoryPtr ipWorkspaceFactory<br />

(CLSID_RasterWorkspaceFactory);<br />

IWorkspacePtr ipWorkspace;<br />

HRESULT hr = ipWorkspaceFactory->OpenFromFile(inPath, 0, &ipWorkspace);<br />

if (FAILED(hr) || ipWorkspace == 0)<br />

{<br />

std::cerr

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

Saved successfully!

Ooh no, something went wrong!