开发者

FindResource PNG fails?

开发者 https://www.devze.com 2023-02-01 05:20 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消