A call to LoadImage() in the first steps of my program returns NULL. Just after it, GetLastError() is called, and it surprisingly returns 0.
I wondered why LoadImage() is failing, since GetLastError() clearly reveals that no error code is set after the failed function.
This is a snippet of the code:
if ( (hbitmap = (HBITMAP) LoadImage(hThisInstance, MAKEINTRESOURCE(MY_BITMAP),
IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION)) == NULL)
printf("Last error: %d\n", GetLastError());
With HBITMAP hbitmap, HINSTANCE hThisInstance (argument of WinMain), and MY_BITMAP a valid bitmap resource.
FindResourcereturn for that bitmap? - Dabbler0 x 0pixels and you are not requestingLR_DEFAULTSIZE, was this the intent? - Roman R.