I am trying t开发者_运维知识库o 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..
FindResource(.., TEXT("IDB_PNG1"), ...);
That's wrong, the ID is a number, not a string. Use MAKEINTRESOURCE(IDB_PNG1).
FindResourceEx had to be used and Neutral language explicitly set.
精彩评论