microsoft/Windows-classic-samples

x64 runtime crash issue with WicAnimatedGif sample

smourier opened this issue · 0 comments

We can compile the https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/Win7Samples/multimedia/wic/wicanimatedgif sample successfully but it crashes at execution here:

https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/Win7Samples/multimedia/wic/wicanimatedgif/WicAnimatedGif.cpp#L445

SetWindowLongPtr(hWnd, GWLP_USERDATA, PtrToUlong(pThis));

I think this line should be replaced by

SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pThis));

which compiles and runs fine.