ICoreWebView2ExecuteScriptResult
COMメソッド 4
vtbl = vtable インデックス(0始まり)。HSP等からインデックス指定でCOMメソッドを呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 3 HRESULT get_Succeeded(BOOL* value)
| value | BOOL* | out | スクリプトの実行が例外なく成功したかどうかを受け取るポインタである。 |
vtbl 4 HRESULT get_ResultAsJson(LPWSTR* jsonResult)
| jsonResult | LPWSTR* | out | スクリプトの実行結果を JSON 形式で表した文字列を受け取るポインタである。不要になったら CoTaskMemFree で解放する必要がある。 |
vtbl 5 HRESULT TryGetResultAsString(LPWSTR* stringResult, BOOL* value)
| stringResult | LPWSTR* | out | 実行結果が文字列型である場合に、その文字列値を受け取るポインタである。不要になったら CoTaskMemFree で解放する必要がある。 |
| value | BOOL* | out | 実行結果を文字列として取得できたかどうかを受け取るポインタである。 |
vtbl 6 HRESULT get_Exception(ICoreWebView2ScriptException** exception)
| exception | ICoreWebView2ScriptException** | out | スクリプト実行時にスローされた例外を表す ICoreWebView2ScriptException を受け取るポインタである。例外がない場合は NULL が返る。 |
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。WebView2 のインターフェースは環境/ローダ経由で取得するため #usecom 末尾は "{}"。
出力引数:
#define global IID_ICoreWebView2ExecuteScriptResult "{0CE15963-3698-4DF7-9399-71ED6CDD8C9F}" #usecom global ICoreWebView2ExecuteScriptResult IID_ICoreWebView2ExecuteScriptResult "{}" #comfunc global ICoreWebView2ExecuteScriptResult_get_Succeeded 3 var #comfunc global ICoreWebView2ExecuteScriptResult_get_ResultAsJson 4 var #comfunc global ICoreWebView2ExecuteScriptResult_TryGetResultAsString 5 var,var #comfunc global ICoreWebView2ExecuteScriptResult_get_Exception 6 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。#define global IID_ICoreWebView2ExecuteScriptResult "{0CE15963-3698-4DF7-9399-71ED6CDD8C9F}" #usecom global ICoreWebView2ExecuteScriptResult IID_ICoreWebView2ExecuteScriptResult "{}" #comfunc global ICoreWebView2ExecuteScriptResult_get_Succeeded 3 sptr #comfunc global ICoreWebView2ExecuteScriptResult_get_ResultAsJson 4 sptr #comfunc global ICoreWebView2ExecuteScriptResult_TryGetResultAsString 5 sptr,sptr #comfunc global ICoreWebView2ExecuteScriptResult_get_Exception 6 sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。