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 />

void GiveGraphic(Graphic* graphic);<br />

Graphic* TakeGraphic(int itemNum);<br />

Use function overloading when a particular operation works with different<br />

argument types:<br />

void Append(const CString& text);<br />

void Append(int number);<br />

Argument names<br />

Use descriptive argument names in function declarations. The argument name<br />

should clearly indicate what purpose the argument serves:<br />

bool Send(int messageID, const char* address, const char* message);<br />

Debugging tips in <strong>Developer</strong> Studio<br />

Visual C++ comes with a feature-rich debugger. These tips will help you get the<br />

most from your debugging session.<br />

Backing up after failure<br />

When a function call has failed and you’d like to know why (by stepping into<br />

it), you don’t have to restart the application. Use the Set Next Statement<br />

command to reposition the program cursor back to the statement that failed<br />

(right-click the statement to bring up the debugging context menu). Then, just<br />

step into the function.<br />

Edit and Continue<br />

Visual Studio 6 allows changes to source code to be made during a debugging<br />

session. The changes can be recompiled and incorporated into the executing code<br />

without stopping the debugger. There are some limitations to the type of changes<br />

that can be made; in this case the debug session must be restarted. This feature is<br />

enabled by default; the settings are available in Settings of the project menu.<br />

Click the C/C++ tab and click General from the Category dialog box. In the<br />

Debug info dialog box, click Program Database for Edit and Continue.<br />

Unicode string display<br />

Set your debugger options to display Unicode strings (click the Tools menu,<br />

click Options, click Debug, then check the Display Unicode Strings check box).<br />

Variable value display<br />

Pause the cursor over a variable name in the source code to see its current<br />

value. If it is a structure, click it and bring up the QuickWatch dialog box (click<br />

the Eyeglasses button or press Shift+F9) or drag and drop it into the Watch<br />

window.<br />

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