开发者

FindResource PNG fails?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜