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.

VISUAL C++<br />

LRESULT C<strong>Engine</strong>ControlsDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM<br />

lParam, BOOL& bHandled)<br />

{<br />

// Get the Control's interfaces into class member variables.<br />

GetDlgControl(IDC_TOOLBARCONTROL, IID_IToolbarControl, (void **)<br />

&m_ipToolbarControl);<br />

GetDlgControl(IDC_TOCCONTROL, IID_ITOCControl, (void **) &m_ipTOCControl);<br />

GetDlgControl(IDC_PAGELAYOUTCONTROL, IID_IPageLayoutControl, (void **)<br />

&m_ipPageLayoutControl);<br />

// Connect to the controls.<br />

AtlAdviseSinkMap(this, TRUE);<br />

// Set buddy controls.<br />

m_ipTOCControl->SetBuddyControl(m_ipPageLayoutControl);<br />

m_ipToolbarControl->SetBuddyControl(m_ipPageLayoutControl);<br />

return TRUE;<br />

}<br />

Known limitations of Visual Studio C++ Resource Editor and <strong>ArcGIS</strong><br />

ActiveX controls<br />

Disabled buddy property on property page<br />

In Visual Studio C++ you cannot set the Buddy property of the TOCControl and<br />

the ToolbarControl through the General property page. Visual C++ does not support<br />

controls finding other controls at design time. However, this step can be<br />

performed in code in the OnInitDialog method.<br />

ToolbarControl not resized to the height of one button<br />

In other environments (Visual Basic 6, .NET) the ToolbarControl will automatically<br />

resize to be one button high. However, in Visual Studio C++ 6 it can be any<br />

size. In MFC and ATL, the ActiveX host classes do not allow controls to determine<br />

their own size.<br />

Design-time property pages disappearing when displaying context-sensitive<br />

help<br />

When viewing the controls property page at design time, right-clicking and clicking<br />

“What’s This?” will cause the help tip to display; however, the property pages<br />

will then close. This is a limitation of the Visual Studio floating windows combined<br />

with the floating tip window from HTML help. Clicking the Help button<br />

provides the same text for the whole property page.<br />

MFC AND THE ACTIVEX CONTROLS<br />

There are many choices for how to work with <strong>ArcGIS</strong> ActiveX controls in Visual<br />

C++, the first of which is what framework to use to host the controls (for<br />

example, ATL or MFC). A second decision is where the control will be hosted<br />

(Dialog, MDI application, and so forth). This section discusses MFC and hosting<br />

the control on a dialog box.<br />

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

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

Saved successfully!

Ooh no, something went wrong!