c++ - Windows loadimage function fails but gelasterror function also returns null -
how can loadimage return null getlasterror returns null - doesn't make sense. here simple program demonstrates problem:
#include <windows.h> #include <stdio.h> void main() { int e; hicon icon; icon = (hicon)loadimage(null, "\\temp\\icona.ico", image_icon,0,0,lr_loadfromfile); e = getlasterror(); printf("result: %x %d \n",icon, e ); return; }
when compile, link , run get:
result: 0 0