YouTube | Facebook | X(Twitter) | RSS

既存コマンドの CLSID を取得する方法

2016/9/1 (木)

'■ThisDocument
-----------------------------------
Dim m_pCustomizationFilterr As ICustomizationFilter
 
Private Function MxDocument_BeforeCloseDocument() As Boolean
        Application.UnlockCustomization "password"
End Function
  
Private Function MxDocument_NewDocument() As Boolean
    Set m_pCustomizationFilterr = New clsMyCustFilter
    Application.LockCustomization "password", m_pCustomizationFilterr
  
End Function
  
Private Function MxDocument_OpenDocument() As Boolean
    Set m_pCustomizationFilterr = New clsMyCustFilter
    Application.LockCustomization "password", m_pCustomizationFilterr
End Function
 
 
'■clsMyCustFilter.cls
-----------------------------------
Implements ICustomizationFilter
 
Private Function ICustomizationFilter_OnCustomizationEvent(ByVal custEventType As esriCustomizationEvent, ByVal eventCtx As Variant) As Boolean
Dim lSubType As Long
 
    If custEventType = esriCEInvokeCommand Then
        Dim pCommandItem As ICommandItem
        Set pCommandItem = eventCtx
 
        Debug.Print "Name: ", pCommandItem.Name
        Debug.Print "Category: ", pCommandItem.Category
        Debug.Print "Caption: ", pCommandItem.Caption
        Debug.Print "CLSID: ", pCommandItem.ID.Value
        Debug.Print
    End If
 
End Function

関連記事

  • この記事を書いた人

羽田 康祐

伊達と酔狂のGISエンジニア。GIS上級技術者、Esri認定インストラクター、CompTIA CTT+ Classroom Trainer、潜水士、PADIダイブマスター、四アマ。WordPress は 2.1 からのユーザーで歴だけは長い。 代表著書『地図リテラシー入門―地図の正しい読み方・描き方がわかる』 GIS を使った自己紹介はこちら。ESRIジャパン(株)所属、元青山学院大学非常勤講師を兼務。日本地図学会第31期常任委員。発言は個人の見解です。

-プログラミング, ArcGIS
-,

WINGFIELD since1981をもっと見る

今すぐ購読し、続きを読んで、すべてのアーカイブにアクセスしましょう。

続きを読む