-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Problem/Bug]: Inappropriate use of CHECK_FEATURE_RETURN in InitializeFindOptions sample code #5064
Comments
Any update? |
Thanks for pointing it out. But this is an outdates branch so please don't refer to it. Closing the issue. Please reopen if you have more to discuss |
This ticket should not be closed. Even in the new documentation: It is still using incompatible code: bool AppWindow::Start(const std::wstring& searchTerm)
{
auto webView2Experimental29 = m_webView.try_query<ICoreWebView2Experimental29>();
CHECK_FEATURE_RETURN(webView2Experimental29); That needs to be addressed. Understandably we as users can't keep up with beta copies of the documentation so it is appreciated if our feedback is applied accordingly and carried across. After-all, it is marked as "tracked" and yet not completed, but closed. Don't have rights to re-open. |
The function mentioned in the official documentation : |
The code I stated has nothing to do with Start in itself: auto webView2Experimental29 = m_webView.try_query(); webView2Experimental29 Is not a bool. So this is invalid: CHECK_FEATURE_RETURN(webView2Experimental29); We are not checking for a bool but a null pointer. As I originally stated. |
The type of webview2Experimental29 doesn't matter here, because that's what we are passing to the macro. The type that is returned from the macro matters. In the function, that you mentioned above, was returning But in the documentation the function ( that is AppWindow::Start ) is returning bool and hence CHECK_FEATURE_RETURN works there. I hope I was able to make things clear. Please tell me if I'm wrong in understanding your concern |
No. It does not help. I already know that. It is why I made the macro. I restate:
The sample code is using a macro that expects a bool. We are on the same page. But you are not acknowledging the mistake in the sample code. Put simply, it will not compile as repeatedly explained.
Sent from Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Chetan Pandey ***@***.***>
Sent: Wednesday, February 26, 2025 11:00:49 AM
To: MicrosoftEdge/WebView2Feedback ***@***.***>
Cc: ajtruckle ***@***.***>; Author ***@***.***>
Subject: Re: [MicrosoftEdge/WebView2Feedback] [Problem/Bug]: Inappropriate use of CHECK_FEATURE_RETURN in InitializeFindOptions sample code (Issue #5064)
The type of webview2Experimental29 doesn't matter here, because that's what we are passing to the macro. The type that is returned from the macro matters.
In the function, that you mentioned above, was returning wil::com_ptr which is why CHECK_FEATURE_RETURN ( which returns bool ) shouldn't be used there and your macro that is CHECK_FEATURE_RETURN_NULL would work.
But in the documentation the function ( that is AppWindow::Start ) is returning bool and hence CHECK_FEATURE_RETURN works there.
I hope I was able to make things clear. Please tell me if I'm wrong in understanding your concern
—
Reply to this email directly, view it on GitHub<#5064 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB45RMYI6JRDZ422ZTI7NPL2RWNGDAVCNFSM6AAAAABWAD4BV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBUGYZTCNBTGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[chetanpandey1266]chetanpandey1266 left a comment (MicrosoftEdge/WebView2Feedback#5064)<#5064 (comment)>
The type of webview2Experimental29 doesn't matter here, because that's what we are passing to the macro. The type that is returned from the macro matters.
In the function, that you mentioned above, was returning wil::com_ptr which is why CHECK_FEATURE_RETURN ( which returns bool ) shouldn't be used there and your macro that is CHECK_FEATURE_RETURN_NULL would work.
But in the documentation the function ( that is AppWindow::Start ) is returning bool and hence CHECK_FEATURE_RETURN works there.
I hope I was able to make things clear. Please tell me if I'm wrong in understanding your concern
—
Reply to this email directly, view it on GitHub<#5064 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB45RMYI6JRDZ422ZTI7NPL2RWNGDAVCNFSM6AAAAABWAD4BV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBUGYZTCNBTGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
What happened?
The
CHECK_FEATURE_RETURN
macro can't be used in the proposedInitializeFindOptions
method:This is because it returns
true
upon success. So I adapted by adding a new macro:The sample code should be revised.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Prerelease (Edge Canary/Dev/Beta)
Runtime Version
134.0.3101.0 canary
SDK Version
1.0.3079 prerelease
Framework
Win32
Operating System
Windows 11
OS Version
10.0.26100 24H2
Repro steps
Try to use the sample in the Find documentation for Win32.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: