Win32 API 日本語リファレンス
ホームSystem.Mmc › Document

Document

COMIDispatch (デュアル)
IDispatch を実装(デュアルインターフェース)。HSP では comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。
IID225120d6-1e0f-40a3-93fe-1079e6a8017b継承元IDispatch呼び出し名前(IDispatch) または vtbl自前メソッド開始 vtbl7

メソッド 16

vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。

vtbl 7 HRESULT Save()
vtbl 8 HRESULT SaveAs(LPWSTR Filename)
FilenameLPWSTRinドキュメントの保存先となるファイルのパスを指定する。
vtbl 9 HRESULT Close(BOOL SaveChanges)
SaveChangesBOOLin閉じる前に変更を保存するかどうかを指定する。
vtbl 10 HRESULT get_Views(Views** Views)
ViewsViews**outドキュメント内のビューの集合を表す Views オブジェクトを受け取るポインタである。
vtbl 11 HRESULT get_SnapIns(SnapIns** SnapIns)
SnapInsSnapIns**outドキュメントに追加されているスナップインの集合を表す SnapIns オブジェクトを受け取るポインタである。
vtbl 12 HRESULT get_ActiveView(View** View)
ViewView**out現在アクティブなビューを表す View オブジェクトを受け取るポインタである。
vtbl 13 HRESULT get_Name(LPWSTR* Name)
NameLPWSTR*outドキュメントの名前を受け取る文字列へのポインタである。
vtbl 14 HRESULT put_Name(LPWSTR Name)
NameLPWSTRinドキュメントに設定する名前を指定する。
vtbl 15 HRESULT get_Location(LPWSTR* Location)
LocationLPWSTR*outドキュメントの保存場所 (ファイルパス) を受け取る文字列へのポインタである。
vtbl 16 HRESULT get_IsSaved(BOOL* IsSaved)
IsSavedBOOL*outドキュメントが保存済みで未変更かどうかを受け取る BOOL へのポインタである。
vtbl 17 HRESULT get_Mode(_DocumentMode* Mode)
Mode_DocumentMode*outドキュメントの編集モード (作成者モードかユーザーモードか等) を受け取る _DocumentMode へのポインタである。
vtbl 18 HRESULT put_Mode(_DocumentMode Mode)
Mode_DocumentModeinドキュメントに設定する編集モードを示す _DocumentMode 値を指定する。
vtbl 19 HRESULT get_RootNode(Node** Node)
NodeNode**outドキュメントのルートノードを表す Node オブジェクトを受け取るポインタである。
vtbl 20 HRESULT get_ScopeNamespace(ScopeNamespace** ScopeNamespace)
ScopeNamespaceScopeNamespace**outドキュメントのスコープ名前空間を表す ScopeNamespace オブジェクトを受け取るポインタである。
vtbl 21 HRESULT CreateProperties(Properties** Properties)
PropertiesProperties**out新規に作成した空のプロパティコレクション (Properties) を受け取るポインタである。
vtbl 22 HRESULT get_Application(_Application** Application)
Application_Application**outこのドキュメントを所有する _Application オブジェクトを受け取るポインタである。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"

出力引数:
#define global IID_Document "{225120D6-1E0F-40A3-93FE-1079E6A8017B}"
#usecom global Document IID_Document "{}"
#comfunc global Document_Save                7
#comfunc global Document_SaveAs              8 wstr
#comfunc global Document_Close               9 int
#comfunc global Document_get_Views           10 sptr
#comfunc global Document_get_SnapIns         11 sptr
#comfunc global Document_get_ActiveView      12 sptr
#comfunc global Document_get_Name            13 var
#comfunc global Document_put_Name            14 wstr
#comfunc global Document_get_Location        15 var
#comfunc global Document_get_IsSaved         16 var
#comfunc global Document_get_Mode            17 var
#comfunc global Document_put_Mode            18 int
#comfunc global Document_get_RootNode        19 sptr
#comfunc global Document_get_ScopeNamespace  20 sptr
#comfunc global Document_CreateProperties    21 sptr
#comfunc global Document_get_Application     22 sptr
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。
; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。