菜鸟问大虾:Where is my Icon?(祥见下)

SearchAlone 2000-09-01 10:04:00
I am a beginner of BCB,and nowadays I turn to learn windows SDK,I encouter a problem that the icons in my resource file can't be loaded in memory,just like that...
//resouce file,consisting of three icons
#pragma resource "icons.res"
//the follow code to load the icon
...
Graphics::TIcon *Icons[3];
...
__fastcall TForm1::TForm1(TComponent* Owner): TForm(Owner)
{for(int i=0;i<3;i++)
Icons[i]=new Graphics::TIcon;

Icons[0]->Handle=::LoadIcon(HInstance,"Icon1");
Icons[1]->Handle=::LoadIcon(HInstance,"Icon2");
Icons[2]->Handle=::LoadIcon(HInstance,"Icon3");
}
in fact,I get nothing by the following code:
...
if(Icons[i]->Handle==NULL)
ShowMessage("Icon allocation failure..");
....
Thank your support!!!
...全文
87 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Wingsun 2000-09-02
  • 打赏
  • 举报
回复
不知道你的Hinstance是如何得来的,是否正确.实际上还有很多的方法可以使用,你可以看一看BCB的帮助.
partime 2000-09-02
  • 打赏
  • 举报
回复
检查资源文件中的图标资源命名,注意大小写

13,822

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧