question

VijayadithyanN-4514 avatar image
0 Votes"
VijayadithyanN-4514 asked Viorel-1 answered

What is wrong with this code?

I mooved recently from c++/cx to Winrt, And usually i would do it like this:

window.PointerPressed^ += new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, App::OnPointerPressed);

and it would work fine, but when i mooved it to winrt, i thought i would have to write it like this:

window.PointerPressed += new TypedEventHandler<CoreWindow, PointerEventArgs>(this, App::OnPointerPressed)

It threw an error but it could easily be resolved by writing it like this:

window.PointerPressed& += new TypedEventHandler<CoreWindow, PointerEventArgs>(this, App::OnPointerPressed);

but then three more errors showed up, Namely: CS2059, E0300, and C259 - Syntax Error '+='

How Can i Fix this?

windows-uwpc++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Viorel-1 avatar image
0 Votes"
Viorel-1 answered

Try something like this:

window.PointerPressed( { this, &App::OnPointerPressed } );


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Viorel-1, Thanks for the help

0 Votes 0 ·