smasherprog / screen_capture_lite

cross platform screen/window capturing library
MIT License
616 stars 156 forks source link

Release crashes in Visual Studio 2022 vcxproj type project (so no cmake) #162

Open thegam3r2045 opened 7 months ago

thegam3r2045 commented 7 months ago

I am on Windows10 x64. I downloaded the Windows_x64_1369.zip file. In the Project properties (All Configurations selected):

Added screen_capture_lite_shared.dll and glfw3.dll files to the folder where the vcxproj file is.

This works fine in Debug mode. But when I run it in Release mode then the program crashes with "read access violation" when it prints the available monitors because the monitors count is 18446744073709551337. This is the first part of the output, it goes on for a while, and then crashes:

Library is requesting the list of monitors to capture! Monitors count: 18446744073709551337 Id=-50333240 Index=60 Height=0 Width=-33686019 OffsetX=-1946144430 OffsetY=1323035824 Name=U☺ Id=638 Index=0 Height=-33686019 Width=1752457552 OffsetX=544039282 OffsetY=1701603654 Name=VMware\VMware Workstation\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\VisualSVN Server\bin;C:\Program Files\TortoiseSVN\bin;C:\opencv\build\x64\vc16\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\Zoli\AppData\Local\Microsoft\WindowsApps;C:\Users\Zoli.dotnet\tools Id=1767332922 Index=2003788910 Height=1835365491 Width=1331442227 OffsetX=1348221507 OffsetY=1919381362 Name= (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\VisualSVN Server\bin;C:\Program Files\TortoiseSVN\bin;C:\opencv\build\x64\vc16\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\Zoli\AppData\Local\Microsoft\WindowsApps;C:\Users\Zoli.dotnet\tools ................etc.

The code I use is copied from Screen_Capture_Example.cpp

jferdelyi commented 6 months ago

Same problem... I also notice that the number of monitors is HUGE for no reason. In debug mode the number of monitor is correct and no problem with windows, everythings is fine.