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 APPLICATIONS WITH ACTIVEX<br />

9. You now need to stub out all of the properties and events of the ICommand<br />

interface, even if you are not going to use some of these. Add the following<br />

code to the ICommand properties and methods.<br />

Private Property Get ICommand_Bitmap() As esriSystem.OLE_HANDLE<br />

ICommand_Bitmap = m_pBitmap<br />

End Property<br />

Private Property Get ICommand_Caption() As String<br />

ICommand_Caption = "Add Date"<br />

End Property<br />

Private Property Get ICommand_Category() As String<br />

ICommand_Category = "CustomCommands"<br />

End Property<br />

Private Property Get ICommand_Checked() As Boolean<br />

ICommand_Checked = False<br />

End Property<br />

Private Property Get ICommand_Enabled() As Boolean<br />

If Not m_pHookHelper.ActiveView Is Nothing Then<br />

ICommand_Enabled = True<br />

Else<br />

ICommand_Enabled = False<br />

End If<br />

End Property<br />

Private Property Get ICommand_HelpContextID() As Long<br />

' Not implemented<br />

End Property<br />

Private Property Get ICommand_HelpFile() As String<br />

' Not implemented<br />

End Property<br />

Private Property Get ICommand_Message() As String<br />

ICommand_Message = "Adds a date element to the page layout"<br />

End Property<br />

Private Property Get ICommand_Name() As String<br />

ICommand_Name = "CustomCommands_Add Date"<br />

End Property<br />

Private Sub ICommand_OnClick()<br />

' Not implemented<br />

End Sub<br />

Private Sub ICommand_OnCreate(ByVal Hook As Object)<br />

Set m_pHookHelper.Hook = Hook<br />

End Sub<br />

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