Reputation: 1331
I am trying to use FindResource to get a handle to a PNG in my .rc file, but it always fails with 1814 - name not found. PNG is certainly in the .rc, its line is:
IDB_PNG1 PNG "Resources\\116.png"
And I am trying to load it using
HRSRC hResource = FindResource(GetModuleHandle(NULL), TEXT("IDB_PNG1"), TEXT("PNG"));
but it always gives a NULL.
Any ideas?
Thanks..
Upvotes: 1
Views: 1252
Reputation: 941970
FindResource(.., TEXT("IDB_PNG1"), ...);
That's wrong, the ID is a number, not a string. Use MAKEINTRESOURCE(IDB_PNG1).
Upvotes: 4