I’m trying to load cursor with
LoadCursorFromFile()
function from WinAPI and have faced such misterious problem: after about 2 hrs playing my game (I’m changing cursor in game) it fails to load the same resourse, which have been loaded many times already (and cursor simply disappear).
Also after
tCursor = LoadCursorFromFile(filename);
DWORD lusterr = GetLastError();
lusterr is 0; File path for LoadCursorFromFile is like “assets/images/cursors/static.cur”.
If it is needed I will share this cursor. But again: it has been loaded many times already and worked fine.
Does anyone have any ideas as to why it all happend?
It sounds like you have a GDI resource leak. Make sure you free whatever resources you acquire (cursors etc).