MicrosoftEdge / WebView2Samples

Microsoft Edge WebView2 samples
870 stars 471 forks source link

cppwinrt Callback #30

Open VerboseOutput opened 4 years ago

VerboseOutput commented 4 years ago
Callback<ICoreWebView2CreateCoreWebView2ControllerCompletedHandler>(
        [hWnd](HRESULT result, ICoreWebView2Controller* controller) -> HRESULT {

Is there a modern C++/WinRT version of Microsoft::WRL::Callback?

rflsouza commented 4 years ago

I don't know if I understood your question correctly! But yes, you are using a modern WRL callback passing a lambda.

Lambda Syntax: [hWnd](HRESULT result, ICoreWebView2Controller* controller) -> HRESULT [ captures ] ( params ) -> returnType { body }

VerboseOutput commented 4 years ago

I’m not very familiar with WRL so I was taking a look at the docs and this note concerned me. IMG_0003