@@ -19,8 +19,8 @@ The following code snippets demonstrate how the ExecuteScriptWithResult can be u
1919``` cpp
2020void ScriptComponent::ExecuteScriptWithResult (LPCWSTR script)
2121{
22- wil::com_ptr<ICoreWebView2Staging2 > webview2 =
23- m_webView.try_query<ICoreWebView2Staging2 >();
22+ wil::com_ptr<ICoreWebView2_10 > webview2 =
23+ m_webView.try_query<ICoreWebView2_10 >();
2424
2525 // The main interface for excute script, the first param is the string
2626 // which user want to execute, the second param is the callback to process
@@ -29,10 +29,10 @@ void ScriptComponent::ExecuteScriptWithResult(LPCWSTR script)
2929 script,
3030 // The callback function has two param, the first one is the status of call.
3131 // it will always be the S_OK for now, and the second is the result struct.
32- Callback<ICoreWebView2StagingExecuteScriptWithResultCompletedHandler >(
32+ Callback<ICoreWebView2ExecuteScriptWithResultCompletedHandler >(
3333 [this](
3434 HRESULT errorCode
35- ICoreWebView2StagingExecuteScriptResult * result) -> HRESULT
35+ ICoreWebView2ExecuteScriptResult * result) -> HRESULT
3636 {
3737 if (errorCode != S_OK || result == nullptr)
3838 {
@@ -41,7 +41,7 @@ void ScriptComponent::ExecuteScriptWithResult(LPCWSTR script)
4141 }
4242 else
4343 {
44- wil::com_ptr<ICoreWebView2StagingExecuteScriptException > exception;
44+ wil::com_ptr<ICoreWebView2ExecuteScriptException > exception;
4545 BOOL is_success;
4646
4747 // User should always invoke the get_IsSuccess firstly to get the execution status.
@@ -164,7 +164,7 @@ void ExecuteScriptWithResultAsync(String script)
164164// / This is the exception struct when ExecuteScriptWithResult return false, user can
165165// / use get_Exception to get it.
166166[uuid(82F22B72-1B22-403E-A0B9-A8816C9C8E45), object, pointer_default(unique)]
167- interface ICoreWebView2StagingExecuteScriptException : IUnknown {
167+ interface ICoreWebView2ExecuteScriptException : IUnknown {
168168
169169 /// This will return the exception className, it would be got from the
170170 /// ` result.exceptionDetail.exception.className ` in json result, this
@@ -186,7 +186,7 @@ interface ICoreWebView2StagingExecuteScriptException : IUnknown {
186186
187187// / This is the result for ExecuteScriptWithResult.
188188[uuid(D2C59C5C-AD36-4CF4-87CF-2F5359F6D4CB), object, pointer_default(unique)]
189- interface ICoreWebView2StagingExecuteScriptResult : IUnknown {
189+ interface ICoreWebView2ExecuteScriptResult : IUnknown {
190190
191191 /// This property is true if ExecuteScriptWithResult successfully executed script with
192192 /// no unhandled exceptions and the result is available in the ResultAsJson property
@@ -206,28 +206,28 @@ interface ICoreWebView2StagingExecuteScriptResult : IUnknown {
206206 /// If IsSuccess return failed, user can use this interface to get exception to handle,
207207 /// otherwise return E_INVALIDARG.
208208 [ propget] HRESULT Exception(
209- [ out, retval] ICoreWebView2StagingExecuteScriptException ** exception);
209+ [ out, retval] ICoreWebView2ExecuteScriptException ** exception);
210210}
211211
212212// / This is the callback for ExecuteScriptWithResult
213213[uuid(CECDD25B-E6E8-4A4E-B890-BBF95932564F), object, pointer_default(unique)]
214- interface ICoreWebView2StagingExecuteScriptWithResultCompletedHandler : IUnknown {
214+ interface ICoreWebView2ExecuteScriptWithResultCompletedHandler : IUnknown {
215215
216216 /// Provides the event args for the execute result.
217217 HRESULT Invoke(
218218 [ in] HRESULT errorCode,
219- [ in] ICoreWebView2StagingExecuteScriptResult * result);
219+ [ in] ICoreWebView2ExecuteScriptResult * result);
220220}
221221
222222// / This is the interface for getting string and exception with ExecuteScriptWithResult
223223[uuid(67E0B57B-1AC7-4395 -9793 -5E4EF9C4B7D9), object, pointer_default(unique)]
224- interface ICoreWebView2Staging2 : IUnknown {
224+ interface ICoreWebView2_10 : IUnknown {
225225
226226 /// New execute javascript for user can get the string result and can get exception
227227 /// if execution fails.
228228 HRESULT ExecuteScriptWithResult(
229229 [ in] LPCWSTR javaScript,
230- [ in] ICoreWebView2StagingExecuteScriptWithResultCompletedHandler * handler);
230+ [ in] ICoreWebView2ExecuteScriptWithResultCompletedHandler * handler);
231231}
232232```
233233
0 commit comments