菜鸟问大虾:Where is my Icon?(祥见下)
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!!!